未捕获的TypeError:无法读取ionic2中未定义的属性“参数”

时间:2017-03-10 06:36:27

标签: angular ionic2

任何人都可以指导我解决此问题。我不知道为什么我在 离子服务 时收到如下错误: -

Error I am getting

我的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 {}

0 个答案:

没有答案