【发布时间】:2017-05-05 05:56:51
【问题描述】:
我正在尝试在页面中使用app.component.ts 函数,但得到错误。
EXCEPTION: Uncaught (in promise): TypeError: undefined is not an object (evaluating 'e.pages.updatePages')
app.component.ts中的函数:
updatePages(pages){
console.log(pages);
}
page.ts中的代码
this.sidebarpage = [{ title: 'My Account', component: MyAccountPage }];
this.pages.updatePages(this.sidebarpage);
已经在page.ts中导入组件并添加@ViewChild(MyApp) pages: MyApp;
【问题讨论】:
标签: javascript angularjs angular typescript ionic2