UI Routing In AngularJS

Posted By : Pankaj Kumar Thakur | 31-Oct-2017

Introduction 

The Ui-Router is a routing framwork for Angularjs built by the AngularUi team.
It provides a different approach than ngRoute in that it changes your application views based on state of the application and just the route URL.

Difference between States and URL routing

1.With State routing our views not tied with url, but we can switch to different views without changing the site url.
2.When use ngRoute we can use ngInclude and others methods to perform these operation and this could get confusing.
    Now with the help of .config() , we can handled all of our states, routing, and views.

Setup of Application using UI-Routing

step-1 import the cdn of ui-route in our index.html file 


 
ui-routing-example
 

 


 
 

step-2 Render the file using  ui-view.

------------------------code here-------------------------------------

for example:  <div ui-view></div>


 

About Author

Author Image
Pankaj Kumar Thakur

Pankaj is a MEAN stack developer and expertise in Front-End for web application using Angulajs,Angularjs2/4 with Framework Ionic,Bootstarp,Javascript and Html5 css3, Singing and Reading are includes in his Hobbies.

Request for Proposal

Name is required

Comment is required

Sending message..