This new module file is to use Lazy loading (which from my point of view has GREATLY improved performance).
If you do not want to use Lazy loading and continue with Ionic as it was, simply delete this module file and delete the selector in your HTML @IonicPage
which he also puts, then you make your routine of adding the page on app.modules.ts
and go on living.
If you want to leave the file and do Lazy loading, do the following:
Leave your file paginaNova.module.ts
thus:
import { NgModule } from '@angular/core';
import { NovaPagina} from './NovaPagina';
import { IonicPageModule } from 'ionic-angular'; // ele cria com IonicModule e isso da erro, tem que ser IonicPageModule
@NgModule({
declarations: [NovaPagina],
imports: [IonicPageModule.forChild(NovaPagina)],
exports: [NovaPagina]
})
export class NovaPaginaModule { } //tem que ser assim: nomeDaPaginaModule
No need to import this page into your app.module.ts
and even on the pages when calling this new page, just use her name in quotes, then a new page push that was like this
import { NovaPagina } from '../novaPagina';
mInhaFuncao(){
this.navCtrl.push(NovaPagina);
}
Becomes
mInhaFuncao(){ // Não precisa mais importar a página.
this.navCtrl.push("NovaPagina");
}
Do this for all project pages and be happy, just create a module for home page and import the IonicPage
in the pagina.ts
and put it under the @Component. Give a little work, but it’s worth it.
I hope I helped :D
Post the error being generated.
– Marcelo de Andrade
Possible duplicate of Property forChild does not exist on type typeof Ionicmodule Ionic 2
– Marcelo de Andrade