我在结合使用Angx 7版本和ngx-translate时遇到问题。升级到7.2.15 ngx-tranlsate后,似乎无法正确初始化TranslationService。在#Talk to your peers about what you are going to do.
git checkout T #get off branch develop
git branch -f develop <old-commit>
git checkout develop
git push -f
#Talk to your peers about what they need to do now,
#and what they must not do.
中,我有以下配置:
app.module
还有一个出口的工厂类:
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpTranslateLoaderFactory,
deps: [
HttpClient
]
}
})
在export function HttpTranslateLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
}
类中,从资产文件夹中获取资源,但是在升级到angular 7之后,它们并未在网络(DevTools)选项卡中列为已下载资源。结果,在所有视图中仅显示翻译键。
有人知道可能是什么问题吗?任何帮助表示赞赏。