ngx-translate报错解决方法

当在"@angular/cli": "1.6.5"版本下

使用最新版本的@ngx-translate/core @ngx-translate/http-loader会报错

ERROR TypeError: Object(...) is not a function
    at TranslateService.get (ngx-translate-core.js:495)
    at TranslatePipe.updateValue (ngx-translate-core.js:768)
    at TranslatePipe.transform (ngx-translate-core.js:801)
    at Object.eval [as updateRenderer] (AppComponent.html:6)
    at Object.debugUpdateRenderer [as updateRenderer] (core.js:14693)
    at checkAndUpdateView (core.js:13807)
    at callViewAction (core.js:14153)
    at execComponentViewsAction (core.js:14085)
    at checkAndUpdateView (core.js:13808)

    at callWithDebugContext (core.js:15056)


解决方法:

这个是因为版本原因导致的,将@ngx-translate/core替换成npm install @ngx-translate/[email protected] --save版本就不会再报错。

你可能感兴趣的:(angular)