我正在使用 Ionic 3(延迟加载(:
我收到此错误,但似乎找不到我的方式错误。
错误:没有应用程序版本的提供程序!
我有:
settings.module.ts
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { SettingsPage } from './settings';
@NgModule({
declarations: [SettingsPage],
imports: [IonicPageModule.forChild(SettingsPage)],
})
export class SettingsPageModule { }
设置.ts
import { AppVersion } from '@ionic-native/app-version';
constructor( public appVersion: AppVersion)
需要将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 { }