这个枚举为我抛出了异常:
export enum UserRole {
CareGiver = 0,
CareReceiver = 1
}
错误是:
ERROR in Illegal state: symbol without members expected, but got {"filePath":"C:/Users/William-Work/Desktop/findchildcare/src/app/shared/enums/user_role_enum.ts","
le","members":["CareGiver"]}.
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/components/app/app.module.ngfactory' in 'C:\Users\William-Work\Desktop\findchildcare\src'
@ ./src/main.ts 3:0-89
@ multi ./src/main.ts
有人可以澄清一下我的枚举声明是否在 Angular 中受支持?
有人可以为这个问题提供解决方案吗?
我的 package.json 包含:
"@angular/animations": "^4.1.3",
"@angular/common": "^4.1.3",
"@angular/compiler": "^4.1.3",
"@angular/core": "^4.1.3",
"@angular/forms": "^4.1.3",
"@angular/http": "^4.1.3",
"@angular/platform-browser": "^4.1.3",
"@angular/platform-browser-dynamic": "^4.1.3",
"@angular/cli": "^1.1.2",
"@angular/compiler-cli": "^4.1.3",
"@angular/language-service": "^4.1.3",
我也试过这个 4.0.0 和 4.3.0,同样的问题。