Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70778

Page not loading with Component

$
0
0

@ionicUser wrote:

Hello everyone

I need some help with an angular related topic.

I have a lazy loaded page and on initialization it should load a component.
But with the component declared the page won’t load.

info.module.ts

import { IonicModule } from '@ionic/angular';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';

import { InfoPage } from './info.page';
import { AttendeeComponent } from "../attendee/attendee.component";

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    RouterModule.forChild([{ path: '', component: InfoPage }])
  ],
  declarations: [
    InfoPage,
    AttendeeComponent
  ]
})
export class InfoPageModule {}

info.page.html

  <ion-content>
    <app-attendee></app-attendee>
  </ion-content>

app-routing.module.ts

{ path: 'info', loadChildren: './info/info.module#InfoPageModule' }

and I call this page with

this.router.navigate(['info'])

If I remove AttendeeComponent from declarations the page loads.
I really don’t know what I’m missing here…

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>