#angular #localization
#angular #локализация
Вопрос:
Я пытаюсь реализовать локализацию в моем недавно созданном приложении angular.
мой пакет.json
"dependencies": {
"@agm/core": "^1.0.0-beta.5",
"@angular/animations": "^10.0.0",
"@angular/cdk": "^9.1.1",
"@angular/common": "^10.0.0",
"@angular/compiler": "^10.0.0",
"@angular/core": "^10.0.0",
"@angular/forms": "^10.0.0",
"@angular/localize": "^10.0.0",
"@angular/platform-browser": "^10.0.0",
"@angular/platform-browser-dynamic": "^10.0.0",
"@angular/router": "^10.0.0",
"@fortawesome/fontawesome-free": "^5.6.3",
"@nestjs/common": "^7.0.0",
"@nestjs/core": "^7.0.0",
"@nestjs/jwt": "^7.1.0",
"@nestjs/mongoose": "^7.0.2",
"@nestjs/passport": "^7.1.0",
"@nestjs/platform-express": "^7.0.0",
"@nestjs/swagger": "^4.5.12",
"@ng-select/ng-select": "^4.0.4",
"@ngrx/effects": "^9.2.0",
"@ngrx/store": "^9.2.0",
"@ngrx/store-devtools": "^9.2.0",
"@nrwl/angular": "10.0.6",
"@swimlane/ngx-charts": "^14.0.0",
"bcrypt": "^5.0.0",
"chart.js": "^2.5.0",
"connect-mongo": "^3.2.0",
"easy-pie-chart": "2.1.x",
"hammerjs": "^2.0.8",
"mongodb": "^3.5.9",
"mongoose": "^5.9.26",
"mongoose-aggregate-paginate-v2": "^1.0.42",
"mongoose-paginate-v2": "^1.3.9",
"mongoose-unique-validator": "^2.0.3",
"next-session": "^3.2.3",
"ng-uikit-pro-standard": "file:ng-uikit-pro-standard-9.3.1.tgz",
"passport": "^0.4.1",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
"reflect-metadata": "^0.1.13",
"rxjs": "~6.5.5",
"screenfull": "3.3.x",
"swagger-ui-express": "^4.1.4",
"tslib": "^1.10.0",
"zone.js": "^0.10.2"
},
npx ng xi18n
ERROR in src/app/app.module.ts(49,25): Error during template compile of 'AppModule'
Expression form not supported in 'reducers'
'reducers' contains the error at src/app/store/index.ts(29,3).
строка 29 является:
export const reducers: ActionReducerMap<NoahState> = {
[fromUnits.featureKey]: fromUnits.reducer,
[fromUnit.featureKey]: fromUnit.reducer,
...
}
итак, насколько я понимаю, выражение динамического именования по какой-то причине не поддерживается, есть ли обходной путь?
Комментарии:
1. Что именно вы имеете в виду под «выражением динамического именования»?
2. @k.vincent Я имею в виду это: [fromUnits.featureKey]: fromUnits.reducer,