Hi guys,
My project is composed of one main module called "index" and an other
module called "Sign-in"
what i am trying to do is to show the index module when launch the web site
and call the sign-in module as a lazyloading to show it in the same
router-outlet
this is the code of first Module
IndexModule :
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {NavbarComponent} from './02_navbar_component/navbar.component';
import {IndexComponent} from './01_index_component/index.component';
import {SliderComponent} from './03_slider_component/slider.component';
import {SlideshowModule} from 'ng-simple-slideshow';
import {PageComponent} from './04_page_component/page.component';
import {BottomComponent} from './05_bottom_component/bottom.component';
import {SharedModule} from '../shared_Module/shared.module';
import {RouterModule, Routes} from '@angular/router';
import { RouterComponent } from './00_router_component/router.component';
import { ContainerComponent } from
'./06_container_component/container.component';
const routes: Routes = [
{path: '', component: IndexComponent, children: [
{path: '', component: ContainerComponent, outlet: 'container'},
{path: 'sign-in', loadChildren:
'./../signIn_Module/sign-in.module#SignInModule'},
{path: '**', redirectTo: '', pathMatch: 'full'}
]},
{path: '**', redirectTo: '', pathMatch: 'full'}
];
@NgModule({
declarations: [
NavbarComponent,
IndexComponent,
SliderComponent,
PageComponent,
BottomComponent,
RouterComponent,
ContainerComponent,
],
imports: [
BrowserModule,
SlideshowModule,
SharedModule,
RouterModule.forRoot(routes),
],
exports: [RouterModule],
providers: [],
bootstrap: [RouterComponent]
})
export class IndexModule {
}
and this is the second module
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SignInComponent } from './01_signIn_component/sign-in.component';
import {RouterModule, Routes} from '@angular/router';
const signRoutes: Routes = [
{path: '', component: SignInComponent, outlet: 'container'}
];
@NgModule({
imports: [
CommonModule,
RouterModule.forChild(signRoutes)
],
declarations: [SignInComponent]
})
export class SignInModule { }
and this is the page of the router
<ul>
<li><a href="">Insctructor</a></li>
<li><a href="">Former</a></li>
<li><a href="">Sign Up</a></li>
<li><a routerLink="/sign-in">Log in</a></li>
</ul><app-navbar></app-navbar>
<router-outlet name="container"></router-outlet>
<app-footer></app-footer>
The problem is when i load the sign in module it show me cannot active an
activated outlet
can any one help please?
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.