I add a child routing module (home.routing.module.ts and home.module.ts)
Home.module.ts
import { ApiService } from './../shared/repository/api.service';
import { NavParamsService } from './../shared/providers/nav-params.service';
import { HttpClientModule } from '@angular/common/http';
import { SideMenuModule } from './../shared/components/side-menu/side-menu.module';
import { FooterToolboardModule } from './../shared/components/footer-toolboard/footer-toolboard.module';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { HomePage } from './home.page';
import { HomePageRoutingModule } from './home-routing.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HomePageRoutingModule,
FooterToolboardModule,
SideMenuModule,
HttpClientModule
],
declarations: [HomePage],
providers: [NavParamsService, ApiService]
})
export class HomePageModule {}
app.module.ts
import { LOCALE_ID, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { HttpClientModule } from '@angular/common/http';
/* import { registerLocaleData } from '@angular/common';
import localeEs from '@angular/common/locales/es';
registerLocaleData(localeEs, navigator.language); */
@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [
BrowserModule,
IonicModule.forRoot(),
AppRoutingModule,
HttpClientModule
],
providers: [
//{provide: LOCALE_ID, useValue: 'es-ES' },
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
],
bootstrap: [AppComponent],
})
export class AppModule {}
Tslint of Visual code:
(element) ion-content: HTMLIonContentElement
‘ion-content’ is not a known element:
- If ‘ion-content’ is an Angular component, then verify that it is part of this module.
- If ‘ion-content’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.ngtsc(-998001)
new-user.page.ts(13, 17): Error occurs in the template of component NewUserPage.
Some threads say we need to add ionicModule, but is declared in the app.module.ts
The app run properly, but tslint say that is not correct.
1 post - 1 participant