Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 335
Harsh Bhalodia Avatar asked Dec 29 '14 15:12

Harsh Bhalodia


People also ask

What is the difference between ngRoute and ui router?

The ui-router is effective for the larger application because it allows nested-views and multiple named-views, it helps to inherit pages from other sections. In the ngRoute have to change all the links manually that will be time-consuming for the larger applications, but smaller application nrRoute will perform faster.

What is ui router in AngularJS?

Angular-UI-Router is an AngularJS module used to create routes for AngularJS applications. Routes are an important part of Single-Page-Applications (SPAs) as well as regular applications and Angular-UI-Router provides easy creation and usage of routes in AngularJS.

What is the difference between ngroute and single page AngularJS application?

When we are using ngRoute of AngularJS the browser does not make any additional requests AngularJS Route uses HashBang -ed URLs, For example a simple URL looks like http://www. AngularjsTutorial.com/first/page. Whereas In a Single Page AngularJS Application the URL usually looks like, http://www. AngularjsTutorial.com/#/first/page.

What is angular UI-router?

What is Angular UI-Router? The UI-Router is a routing framework for AngularJS built by the AngularUI team. It provides a different approach than ngRoute in that it changes your application views based on the state of the application and not just the route URL.

What is routing in AngularJS?

Here we will learn routing in angularjs with an example, how to use ngRoute module in angularjs routing, routing with parameters in angularjs example, routing with multiple local views in angularjs with example. In angularjs routing is the way to view multiple views in the single HTML page.

What is ng-view and $routeprovider in AngularJS?

ng-view – The ng-view directive is used to display HTML content from specified URLs. For more information on ng-view check this URL ng-view directive in angularjs. $routeProvider – By using this component we can configure the routes. By using these components, we can achieve routing easily in angularjs applications.


1 Answers

Yes you can use both.

var myModule = angular.module("myModule", ["ui.router", "ngRoute"]);
like image 124
Suneet Bansal Avatar answered Sep 27 '22 18:09

Suneet Bansal