【发布时间】:2021-09-14 10:32:55
【问题描述】:
我已将我的 Angular 项目更新到版本 12.0.5,将 Typescript 版本更新到 4.3.4,但我在编译项目时遇到了问题。
目前我在没有对分支进行更改的情况下收到以下错误:
Should not import the named export 'provinces' (imported as 'data') from default-exporting module (only default export is available soon)
这是import:
import { ApiService, Municipality, Province } from '../../services/api.service';
这就是我声明依赖于进口省份的变量的方式:
public provinces: Province[] = [];
private currentPorvince: Province;
有什么问题?为什么会发生这种情况,我该如何解决?
【问题讨论】:
-
这能回答你的问题吗? Importing JSON file in TypeScript
标签: angular typescript angular12