I am using angular2 Final for development.
I created 3 modules.
- Appmodule
- Projectmodule
- DesignerModule
Previously, I had only the AppModule into which I imported after the RoutingModule, and it worked fine.
import {NgModule} from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {ProjectManagerComponent} from './project-manager/project-manager.component';
import {DesignerComponent} from './designer/designer.component';
const appRoutes: Routes = [
{path: '',redirectTo: 'project-manager',pathMatch: 'full'},
{ path: 'project-manager', component: ProjectManagerComponent },
{ path: 'designer/:id', component:DesignerComponent }
];
@NgModule({
imports:[RouterModule.forRoot(appRoutes)],
exports:[RouterModule]
})
export class AppRoutingModule { }
export const routingComponents=[ProjectManagerComponent,DesignerComponent]
But recently, I created separate NgModules for ProjectManager and Designer.
I saved ProjectManagerComponent, DesignerComponent inside declarations in my respective modules.
I want to know if these modules can be routed using the same routing configuration or if I need to change something.
My routing no longer works.
any inputs?
source
share