Reputation: 336
Angular 4 router works with absolute path like
loadChildren: 'app/dummy/dummy.module#DummyModule' }
But not working with following
loadChildren: '../dummy/dummy.module#DummyModule' }
' PS:-I want to be worked with relative path How to achieve this in angular router
Upvotes: 0
Views: 75
Reputation: 9687
You can use loadChildren: () =>
I have create a demo on Stackblitz
import { DummyModule } from './dummy/dummy.module';
{ path: 'path', loadChildren: () => DummyModule }
Upvotes: 1
Reputation: 111
You need to change in your code as below. Just remove one dot.
loadChildren: './dummy/dummy.module#DummyModule' }
This will help you.
Upvotes: 0