Previously, I was using ngRoute
in my main controller. I have to create child view functionality and it is only achieved by UI-Router
. please suggest?
Asked
Active
Viewed 3,239 times
9

Radim Köhler
- 122,561
- 47
- 239
- 335

Harsh Bhalodia
- 153
- 1
- 2
- 9
-
You can, as @Suneet suggests -- but you should probably just migrate your application to uiRouter instead of using both. – Martin Dec 29 '14 at 16:03
-
@Martin: Yes you are right. – Suneet Bansal Jan 09 '15 at 18:46
2 Answers
2
Yes you can use both.
var myModule = angular.module("myModule", ["ui.router", "ngRoute"]);

Suneet Bansal
- 2,664
- 1
- 14
- 18
-
-
3No, the two directives will compete for transclusion on the body. Depending on your styling, you could try putting one after the other (i.e., ). – nshew13 Jan 12 '15 at 17:59
2
Yes, you can use ngRoute
/angular-route
($routeProvider
) and ui-router
($stateProvider
) together (in particular, the second inside of the first). Check this repo's master to find the example.
In a couple of words, the ui-router
in this case will have the possibility to provide navigation and nested states/views inside of "ng-view
-provided space".
I have answered almost the same question with more details and pros/cons at Quora

Fyodor
- 247
- 3
- 14