Property forChild does not exist on type typeof IonicModule Ionic 2

1

I've created a new ionic project 2:

 ionic start myApp blank --V2

Until then, only when I create a new page:

ionic g page login

It is giving the following error below:

Typescript Error
Property 'forChild' does not exist on type 'typeof IonicModule'.
E:/workspace/Ionic/myApp/src/pages/login/login.module.ts
imports: [
  IonicModule.forChild(Login),
],

And he is generating the following files:

1.login.html
2.login.ts
3.login.module.ts
4.login.scss

Note: before it also did not generate: login.module.ts And I also saw that in: ionic info appeared Ionic Framework Version: 3.0.1 that before did not appear, but I did not run any updates just created new app:

ionic info

Your system information:

 ordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.
ios-deploy version: Not install
ios-sim version: Not installed
OS: Windows 7
Node Version: v7.8.0
Xcode version: Not installed
    
asked by anonymous 14.04.2017 / 05:00

1 answer

1

Solution:

Import IonicPageModule instead of IonicModule

Change from:

imports: [
  IonicModule.forChild(Login),
],

To:

imports: [
  IonicPageModule.forChild(Login),
],
    
19.04.2017 / 06:23