Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
La propiedad 'forChild' no existe en el tipo 'typeof IonicModule'

Estoy usando el cli iónico para generar la página usando este comando

 ionic generate page login ionic g page login

entonces me sale este error en el navegador

 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), ],

también creando 4 elementos en la carpeta de inicio de sesión.

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

cualquier cuerpo puede resolver esto. aquí está login.module.ts

 import { NgModule } from '@angular/core'; import { IonicModule } from 'ionic-angular'; import { Login } from './login'; @NgModule({ declarations: [ Login, ], imports: [ IonicModule.forChild(Login), ], exports: [ Login ] }) export class LoginModule {}

si elimino esta línea, la aplicación funciona bien.

 IonicModule.forChild(Login),
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Hay

IonicModule.forRoot(MyApp) .

Enlace de Github aquí .

 export class IonicModule { /** * Set the root app component for you IonicModule * @param {any} appRoot The root AppComponent for this app. * @param {any} config Config Options for the app. Accepts any config property. * @param {any} deepLinkConfig Any configuration needed for the Ionic Deeplinker. */ static forRoot(appRoot: any, config: any = null, deepLinkConfig: DeepLinkConfig = null): ModuleWithProviders {

Para arrancar una sola página, puede probar IonicPageModule .

 @NgModule({ imports: [IonicModule], exports: [IonicModule] }) export class IonicPageModule { static forChild(page: any): ModuleWithProviders {

Cambie su importación a:

 imports: [ IonicPageModule.forChild(Login), ]

Actualizar:

Enlaces relevantes: IonicPage , IonicPageModule .

De acuerdo con los documentos de Google compartidos en la discusión aquí, esto se introdujo en ionic 3 para la carga diferida de páginas iónicas.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!