Page has a @IonicPage decorator, but it does not have a corresponding “NgModule”

后端 未结 11 2483
花落未央
花落未央 2020-12-16 11:06

I was working on page navigation in Ionic. After using ionic serve, I got this error:

The Page with .ts extension has a @IonicPage decorator, but

11条回答
  •  时光取名叫无心
    2020-12-16 11:55

    This is because the @IonicPage() decorator is for deep linking, this will register the page in ionic's deep link system.

    You can remove the decorator if you don't want deep link on that page.

    Or you can register that page in your YOURPAGE.module.ts with this code:

    @NgModule({
      declarations: [
        MyPage
      ],
      imports: [
        IonicPageModule.forChild(MyPage)
      ],
      entryComponents: [
        MyPage
      ]
    })
    

    You can find more information in the docs

提交回复
热议问题