Hi guys, please help with a problem, I'm loading my routes from a database
through a web service. Once the page is loaded I can access all the routes
using the links in the page and all works as expected. The problem is that
those routers are not working when refreshing the page or typing directly
the url in the browser's address bar.
a) To load the routes i use:
this.router.config.unshift({ path: item.path, loadChildren: () =>
FormdinamicoModule })
b) the routes are loaded in the app.component.ts constructor.
c) error in the browser for the "testing" route:
Router Event: NavigationStart
NavigationStart(id: 1, url: '/testing')
NavigationStart {id: 1, url: "/testing", navigationTrigger: "imperative",
restoredState: null}
Router Event: NavigationError
NavigationError(id: 1, url: '/testing', error: Error: Cannot match any
routes. URL Segment: 'testing')
NavigationError {id: 1, url: "/testing", error: Error: Cannot match any
routes. URL Segment: 'testing' at ApplyRedirects.push../node_modules/@an…}
core.js:1673 ERROR Error: Uncaught (in promise): Error: Cannot match any
routes. URL Segment: 'testing'
Error: Cannot match any routes. URL Segment: 'testing'
Thank you very much.
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.