Search code examples
angularionic2ng2-translate

ionic2 with ng2-translate throws compilation error


I am building an Ionic2 app and trying to use ng2-translate for localization. I followed https://ionicframework.com/docs/v2/resources/ng2-translate/ this tutorial.

However it gives me some compilation errors as follows:

enter image description here

because of these app can not start. What's going wrong?


Solution

  • Change import { TranslateModule } from 'ng2-translate/ng2-translate'; to import { TranslateModule, TranslateLoader, TranslateStaticLoader } from 'ng2-translate/ng2-translate'.