我是离子3的新手。如何将一种表格方法导航到另一种形式?我拿了两个名为Home和MyFamily的表格。在我的家庭主页中使用navCtrl进行导航,现在我想调用一个方法Editmethod
的主页是MyFamily形式,所以如何在MyFamily页面中调用主页的方法。
当我尝试时,将显示以下错误。
import { Component } from '@angular/core';
import { Items } from '../../providers/providers';
import { PostProvider } from '../../providers/post/post';
import { LaunchNavigator, LaunchNavigatorOptions } from '@ionic-
native/launch-navigator';
import { ToastController } from 'ionic-angular';
import { LoginPage } from '../login/login';
import { partition } from 'rxjs/operator/partition';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { HomePage } from '../../pages/home/home';
@IonicPage()
@Component({
selector: 'page-myfamily',
templateUrl: 'myfamily.html',
})
export class MyfamilyPage {
paralist = {};
modalheader: string;
showData = [];
btnTableDataFirst = [];
currentItems: any = [];
horBtnData = [];
constructor(public navCtrl: NavController,public navParams: NavParams,
public items: Items, public _ps: PostProvider,private home:HomePage,
private launchNavigator: LaunchNavigator,public toastCtrl: ToastController)
{}
btnHorClick(partyName, id, obj) {
this.showData = this.horBtnData['table' + id];
this.navCtrl.push(HomePage, {
param1: JSON.stringify(obj)
});
this.goCam();
}
goCam(){
this.home.editdata();
}
ionViewDidLoad() {
console.log('ionViewDidLoad MyfamilyPage');
this.GetHorizontalBtnData();
}
GetHorizontalBtnData() {
let paralist = {};
paralist['searchText'] = 'vpravinchandra@gmail.com';
paralist['corpcode'] = 'Email';
console.log(paralist)
this._ps.postData(paralist, 'Search')
.subscribe((data) => {
this.horBtnData = data;
this.btnTableDataFirst = data['table'];
for (var i = 0; i < this.btnTableDataFirst.length; i++) {
}
console.log(this.horBtnData)
});
}
}