A
A
Alex2016-11-24 13:46:31
Angular
Alex, 2016-11-24 13:46:31

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

1 answer(s)
A
Artem Kayun, 2016-11-24
@Kayun

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 question

Ask a Question

731 491 924 answers to any question