SB-Admin-BS4-Angular-8 icon indicating copy to clipboard operation
SB-Admin-BS4-Angular-8 copied to clipboard

Error while adding path

Open lokeshsoni04 opened this issue 6 years ago • 2 comments

I have created my own component "about" in components section using ng g c components/about. app.module.ts got updated but I am unable to connect its path. Tried editing app-routing.module.ts->by adding { path: 'about', loadChildren: '.components/about/about.component' } / { path: 'about', component: '.components/about/about.component' } / { path: 'about', component:'AboutComponent' } and importing it. I tried doing last two in app.module page too. But nothing seems to be working. How can I do this?

lokeshsoni04 avatar Mar 22 '18 07:03 lokeshsoni04

same problem here !

achrafbenalaya avatar Mar 26 '18 09:03 achrafbenalaya

A Component need to imported into the file that defines the routes.

It is a reference to the component type. This means it should be imported without quotes.

Although not required you can then remove the selector from the component as it won't be shown as a nested component. It will only be accessible via routes.

More details can be found in the documentation. https://angular.io/guide/router

On Thu, Mar 22, 2018 at 1:15 AM lokeshsoni04 [email protected] wrote:

I have created my own component "about" in components section using ng g c components/about. app.module.ts got updated but I am unable to connect its path. Tried editing app-routing.module.ts->by adding { path: 'about', loadChildren: '.components/about/about.component' } / { path: 'about', component: '.components/about/about.component' } / { path: 'about', component:'AboutComponent' } and importing it. I tried doing last two in app.module page too. But nothing seems to be working. How can I do this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/start-angular/SB-Admin-BS4-Angular-5/issues/223, or mute the thread https://github.com/notifications/unsubscribe-auth/AB4Si7M-cnPTEFk5EvHkBwXCMVD7Hjfuks5tg0-KgaJpZM4S2j5y .

rlove avatar Mar 26 '18 11:03 rlove