Hi guys i jsut starting a project using this command "ionic start helloWorld tabs" it generate tabbed project, then i add a button to push to a new page which is i have a button i want to get back to my main application, here is how i program the new page button
newpage.ts
addItem(item: Item) {
this.shopping.addItem(item).then(ref =>{
this.navCtrl.setRoot('TabsPage', {key : ref.key});
})
}
after i save an item, i would like to get back to my main apps, i do the setRoot to my TabsPage, but i showing me this error
invalid link: TabsPage
here is my tabs.ts
import { Component } from '@angular/core';
import { AboutPage } from '../about/about';
import { ContactPage } from '../contact/contact';
import { HomePage } from '../home/home';
@Component({
templateUrl: 'tabs.html'
})
export class TabsPage {
tab1Root = HomePage;
tab2Root = AboutPage;
tab3Root = ContactPage;
constructor() {
}
}
what i missed here? i should nav to tabspage class right?
UPDATE after i update my code with @Yerkon answer for option two, i got these error :
Error: Uncaught (in promise): Error: Type TabsPage is part of the declarations of 2 modules: AppModule and TabsPageModule! Please consider moving TabsPage to a higher module that imports AppModule and TabsPageModule. You can also create a new NgModule that exports and includes TabsPage then import that NgModule in AppModule and TabsPageModule. Error: Type TabsPage is part of the declarations of 2 modules: AppModule and TabsPageModule! Please consider moving TabsPage to a higher module that imports AppModule and TabsPageModule. You can also create a new NgModule that exports and includes TabsPage then import that NgModule in AppModule and TabsPageModule.
it said i have to move my tabpagemodule higher, is it normal to do this? or there is something i missed?