[Solved] Problem to add a new page to a text tabs

Hi ionic community,

I have created a new application to train me about Ionic (i’m new) but I have a problem that i cannot solve by myself. I try to add a page to a text Tabs but I cannot access to my new page.

Look the code of my new page (it’s like the others pages, like about…)

classements.ts

import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;

@Component({
selector: ‘page-classements’,
templateUrl: ‘classements.html’
})
export class ClassementsPage {

constructor(public navCtrl: NavController) {
}

}

classements.html

import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;

@Component({
selector: ‘page-classements’,
templateUrl: ‘classements.html’
})
export class ClassementsPage {

constructor(public navCtrl: NavController) {
}

}

tabs.ts

import { Component } from ‘@angular/core’;

import { AboutPage } from ‘…/about/about’;
import { ContactPage } from ‘…/contact/contact’;
import { HomePage } from ‘…/home/home’;
import { ClassementsPage } from ‘…/classements/classements’;

@Component({
templateUrl: ‘tabs.html’
})
export class TabsPage {

tab1Root = HomePage;
tab2Root = AboutPage;
tab3Root = ContactPage;
tab4Root = ClassementsPage;

constructor() {

}
}

tabs.html

In this page (I cannot paste the code, i don’t know why) but I add a tab4root with my new page.

Also, i have ridden this (but I didn’t find a solution) :
http://ionicframework.com/docs/components/#tabs

Thanks to help me !

Okay, the error is telling you you didn’t add the newly created component into your app.module.ts. If you add it to your declarations/imports over there, you’re good to go.

1 Like

Thank you so much!!! It’s was so stupid! And I loose something like 2 hours :frowning:

1 Like