我正在使用Ionic 3(延迟加载):
我收到此错误,但似乎无法找到我的方式错误。
错误:没有AppVersion的提供商!
我有:
settings.module.ts
import { AppVersion } from '@ionic-native/app-version';
constructor( public appVersion: AppVersion)
settings.ts
for (var x = 0; x < text.length; x++)
{
var c = str.charAt(x);
//Add code here to do the translation
}
答案 0 :(得分:2)
需要将AppVersion
添加到settings.module.ts
:
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { SettingsPage } from './settings';
import { AppVersion } from '@ionic-native/app-version';
@NgModule({
declarations: [SettingsPage],
imports: [IonicPageModule.forChild(SettingsPage)],
providers: [AppVersion]
})
export class SettingsPageModule { }