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

后端 未结 11 2499
花落未央
花落未央 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:49

    When you add a page using Ionic CLI for example

    ionic generate page newPage

    then it automatically generates file newPage.module.ts and inside newPage.ts it generates a line of text as

    @IonicPage()

    Well, you must delete newPage.module.ts and delete @IonicPage() from newPage.ts

    then open app.module.ts and add newPage inside declarations and entry components.

提交回复
热议问题