Property forChild does not exist on type typeof Ionicmodule Ionic 2

Asked

Viewed 583 times

1

I created a new Ionic project 2:

 ionic start myApp blank --V2

Until then, only when I create a new page:

ionic g page login

He’s making the following mistake 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 it’s generating the following files:

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

Note: before also did not generate: login.module.ts And I also saw that in: ionic info appeared the Ionic Framework Version: 3.0.1 that before did not appear, but I did not manage any update 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

1 answer

1


Solution:

Import the IonicPageModule instead of IonicModule

Change of:

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

To:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.