You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i generated a route using using
ng generate route ROUTE
if i open the app i get lots of errors like this
browser_adapter.js:77 Error: DI Exception
at NoProviderError.BaseException as constructor
at NoProviderError.AbstractProviderError as constructor
at new NoProviderError (reflective_exceptions.js:75)
at ReflectiveInjector_.throwOrNull (reflective_injector.js:776)
at ReflectiveInjector.getByKeyDefault (reflective_injector.js:804)
at ReflectiveInjector.getByKey (reflective_injector.js:767)
at ReflectiveInjector.get (reflective_injector.js:576)
at ElementInjector.get (element_injector.js:23)
at DebugAppView._View_DemocracyAppComponent0.createInternal (DemocracyAppComponent.template.js:24)
at DebugAppView.AppView.create (view.js:66)
hi @yaede7 ,
i tried that. It now loads the page fine.
But when i go to the route by typing in the path in the address bar, it does not load the route page , it keeps showing the main html
So i realized this i have to add a router link to my main page to get the routes to work. <a [routerLink]="['/heroes']">Heroes</a>
Now if i type http://localhost:4200/heroes i actually get to the heroes page. If i remove the link from my main page typing it in address bar does not load the route content.
Activity
jyaede commentedon May 4, 2016
I had the same issue. You need to add ROUTER_PROVIDERS to your bootstrap statement in main.ts
This worked for me
rahulbats commentedon May 5, 2016
hi @yaede7 ,
i tried that. It now loads the page fine.
But when i go to the route by typing in the path in the address bar, it does not load the route page , it keeps showing the main html
rahulbats commentedon May 5, 2016
So i realized this i have to add a router link to my main page to get the routes to work.
<a [routerLink]="['/heroes']">Heroes</a>Now if i type http://localhost:4200/heroes i actually get to the heroes page. If i remove the link from my main page typing it in address bar does not load the route content.
rcollette commentedon May 5, 2016
So you can't deep link without having a router link somewhere? Is this a bug?
bug: provider not being added to the app component
bug: provider not being added to the app component
angular-automatic-lock-bot commentedon Sep 5, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.