[closed ]Import page in page

whats i make wrong, i try import conta page in agenda page!

show me app.module.ts

1 Like

Whats the name of your class in Conta.ts? I presume you didn’t use the name of the exported class in your import or that you missing something in your app.module.ts.

1 Like
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { agenda } from '../pages/agenda/agenda';
import { home } from '../pages/home/home';
import { conta } from '../pages/conta/conta'

import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

@NgModule({
  declarations: [
    MyApp,
    agenda,
    home,
    conta
  ],
  imports: [
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    agenda,
    home,
    conta
  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

is conta really the name of your exported module? Could you post the contents of Conta.ts also? BTW you’re missing some trailing ; on your import statements.

1 Like

Missing ; after import { conta } from ‘…/pages/conta/conta’

1 Like

in agenda.ts too: import { conta } from ‘…/pages/conta/conta’ missing ;

1 Like

But did it fix your error? I think it should only give you some warnings, maybe linting errors.

1 Like

Semicolons are optional before line breaks. I agree they’re nice to have, but can’t be relevant to the fundamental problem.

1 Like
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';

/**
 * Generated class for the Conta page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */
@IonicPage()
@Component({
  selector: 'page-conta',
  templateUrl: 'conta.html',
})
export class Conta {

  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad Conta');
  }

}

Case matters. ‘conta’ != ‘Conta’.

1 Like

i fix all… conta. but error.

I don’t do screenshots of errors. Please post the error message and the offending code as text.

image

I do not see any text.

1 Like

thank you, i found the error. sorry for lost ur time help me.

conta is different Conta… conta != Conta

1 Like