任何人都可以指导我解决此问题。我不知道为什么我在 离子服务 时收到如下错误: -
我的rootPage是Dashboard: 以下是与仪表板组件相关的代码。
dashboard.ts
import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
@Component({
selector: 'page-dashboard',
templateUrl: 'dashboard.html'
})
export class DashboardPage {
constructor(public navCtrl: NavController, public navParams:NavParams) {}
ionViewDidLoad() {
console.log('ionViewDidLoad DashboardPage');
}
}
dashboard.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'dashboard'
})
export class DashboardComponent {
text: string;
constructor() {
console.log('Hello Dashboard Component');
this.text = 'Hello World';
}
}
dashboard.module.ts
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { DashboardComponent } from './dashboard.component';
import { DashboardPage } from './components/dashboard/dashboard';
@NgModule({
declarations: [,
DashboardComponent,
DashboardPage
],
imports: [
],
bootstrap: [IonicApp],
entryComponents: [
DashboardComponent,
DashboardPage
],
providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}]
})
export class DashbaordModule {}