Answer the question
In order to leave comments, you need to log in
How to pass route path from component to Angular2?
The first Angular has a UI Router. It has $stateProvider.
I could pull this $stateProvider from any module and say that the path of this module in the routes would be like this.
The second has just a Router. How to repeat this feature in it and specify RoutPath in the component?
Answer the question
In order to leave comments, you need to log in
Use RouterModule https://angular.io/docs/ts/latest/api/router/index...
In the root module, use RouterModule.forRoot to initialize the Router service. And in the RouterModule.forChild submodules, add the routes you need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question