Can we use ngRoute and ui.router together in angularJS app.js?

I used to use ngRoute in my main controller. I need to create child viewing functionality, and this is achieved only by the UI-Router . please suggest?

+7
angularjs angularjs-routing angular-ui-router
source share
2 answers

Yes you can use both.

 var myModule = angular.module("myModule", ["ui.router", "ngRoute"]); 
+2
source share

Yes, you can use ngRoute / angular-route ( $routeProvider ) and ui-router ( $stateProvider ) together (specifically the second inside the first). Check out this repo wizard to find an example. In a nutshell, the ui-router in this case will be able to provide navigation and nested states / views inside the " ng-view space". I answered almost the same question with more details and pros / cons in Quora

0
source share

All Articles