Ionic Uncaught (in promise): invalid link

后端 未结 5 784
再見小時候
再見小時候 2021-01-12 01:58

I have probably a problem with this.nav.push in Ionic. I have done a login/registration page but when I login, I get this error message. I have to add some code

5条回答
  •  孤城傲影
    2021-01-12 02:43

    what you need to do is to add @IonicPage() before '@Component' and import 'IonicPage' like this : import {NavController, IonicPage} from 'ionic-angular';

    then you need to create a module for the homepage i.e in the home directory , create home.module.ts with the following contents

    import { NgModule } from '@angular/core';
    import { IonicPageModule } from 'ionic-angular';
    import { HomePage } from './home';
    
    @NgModule({
      declarations: [
        HomePage
      ],
      imports: [
        IonicPageModule.forChild(HomePage),
      ],
      exports: [
        HomePage
      ]
    })
    export class HomePageModule {}
    

    and reload the project

提交回复
热议问题