我正在使用 angular 6.1.0 angular-cli 7 primeng 7:出现错误 "Initializers are not allowed in ambient context"
I am using angular 6.1.0 angular-cli 7 primeng 7 : getting error as "Initializers are not allowed in ambient context"
ERROR in
node_modules/primeng/components/picklist/picklist.d.ts(65,28): error
TS1039: Initializers are not allowed in ambient contexts.
node_modules/primeng/components/picklist/picklist.d.ts(66,28): error
TS1039: Initializers are not allowed in ambient contexts.
我检查了 primeng 包
primeng/components/picklist/picklist.d.ts
line number 65
line number 66
readonly SOURCE_LIST = -1;
readonly TARGET_LIST = 1;
Error : Initializers are not allowed in ambient context because of
above variable
PrimeNG 7.x requires Angular 7.
请始终确保 PrimeNG 的主要版本与
Angular 喜欢 PrimeNG 6.x 和 Angular 6.x.
Angular 像 PrimeNG 7.x 和 Angular 7.x.
我也遇到了同样的问题,我只是将angular版本6升级到Angular7。
它解决了我所有与 prime ng 相关的问题。
For upgrade form angular 6 to 7 just flow the angular official website
Link
ERROR in node_modules/primeng/components/picklist/picklist.d.ts(65,28): error TS1039: Initializers are not allowed in ambient contexts. node_modules/primeng/components/picklist/picklist.d.ts(66,28): error TS1039: Initializers are not allowed in ambient contexts.
我检查了 primeng 包
primeng/components/picklist/picklist.d.ts
line number 65
line number 66
readonly SOURCE_LIST = -1;
readonly TARGET_LIST = 1;
Error : Initializers are not allowed in ambient context because of above variable
PrimeNG 7.x requires Angular 7.
请始终确保 PrimeNG 的主要版本与 Angular 喜欢 PrimeNG 6.x 和 Angular 6.x.
Angular 像 PrimeNG 7.x 和 Angular 7.x.
我也遇到了同样的问题,我只是将angular版本6升级到Angular7。 它解决了我所有与 prime ng 相关的问题。
For upgrade form angular 6 to 7 just flow the angular official website Link