在最新版下如何实现5-2课程中的功能?根据id获取控件
import { Component } from '@angular/core';
import { HomePage } from '../home/home';
import { AboutPage } from '../about/about';
import { ContactPage } from '../contact/contact';
import { IonicApp } from 'ionic-angular';
@Component({
templateUrl: 'tabs.html'
})
export class TabsPage {
static get parameters(){
return [[IonicApp]];
}
// this tells the tabs component which Pages
// should be each tab's root Page
tab1Root: any = HomePage;
tab2Root: any = AboutPage;
tab3Root: any = ContactPage;
app : any = IonicApp;
// app : any = IonicApp;
constructor(app:IonicApp) {
debugger;
this.app = app;
}
ionViewDidEnter(){
let mainTabs = this.app.getComponent("mainTabs");
mainTabs.select(1);
}
}
代码如上所示,目前是报错说this.app没有getComponent方法,求正确写法和大致语法(文档链接即可)