Issue
I have a Module Feature in NPM. I can load this module this way:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { MyContentModule } from 'my-contentModule'
const routes: Routes = [
{
path: 'my-path',
loadChildren: ()=> MyContentModule
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
The code above works. But I need pass a data configuration to my module in forRoot Method.
I try this unsuccessfully:
const routes: Routes = [
{
path: 'my-path',
loadChildren: ()=> MyContentModule.forRoot({})
}
];
What are the alternatives to this problem?
Solution
To stay registered, I can pass a data this way:
MyContentModule.forRoot({}).ngModule
Answered By - J.R
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.