How do we work with UI-Router in AngularJS?

0 votes
I want to know what are the steps to be followed in order to work with UI-Router in AngularJS?
5 days ago in Angular by kartik
• 1,910 points
14 views

1 answer to this question.

0 votes

Hello @kartik,

 As you know Ui-Router is more flexible and provide more features than ngRouter, so there is a bit different in working with UI-Router for which you can follow the steps below:

1. Include Ui-Router module.

    

2. Use UI-Router as module dependency.

     var app= angular.module( 'app', ['ui-router']);

 3.Use $stateProvider to configure state and routes like:

       3.1 states

       3.2 Routinh URL(Location)

       3.3 Views 

       3.4 Controller associated with views

       3.5 Nested views/states

 4. Declare ui-view in order to inject(hold) the content(view). You can have multiple ui-view or nested view

      <div ng-view>

       </div>
answered 5 days ago by Niroj
• 3,230 points

Related Questions In Angular

0 votes
1 answer

How can we provide condition based on certain resolve result obtained in routing with resolve?

Hey,  Let me consider that you have some ...READ MORE

answered 5 days ago in Angular by Niroj
• 3,230 points
11 views
0 votes
1 answer

What is UI-Router in AngularJs?

Routing is just another way of fixing some content ...READ MORE

answered 5 days ago in Angular by anonymous
• 3,230 points
20 views
0 votes
1 answer

What is the service that is used to configure the UI-Router and ngRoute in AngularJs?

Routing comes into play whenever you want ...READ MORE

answered 5 days ago in Angular by anonymous
• 3,230 points
12 views
0 votes
1 answer

How compile, controller, pre-linking and post linking works in Angularjs?

Explanation of compile and link process don't ...READ MORE

answered Jan 31 in Angular by Niroj
• 3,230 points
18 views
0 votes
0 answers
0 votes
0 answers

Anyone can help me out to understand the semantic of (document.getElementBYId("demo").innerHTML="Hello") ?

Hello guys, Can Someone helps me to find ...READ MORE

Jan 17 in Web Development by anonymous
• 1,910 points
26 views
+1 vote
1 answer

What is the relationship between angularjs Scope with controller/view?

Let us consider the below block: <div ng-controller="emp"> ...READ MORE

answered Jan 20 in Web Development by Niroj
• 3,230 points

edited Jan 21 by Niroj 29 views
+1 vote
1 answer

What are pseudo class in css??

Hey, The state of an element is controlled  by ...READ MORE

answered Jan 20 in Web Development by Niroj
• 3,230 points

edited Jan 21 by Niroj 22 views
0 votes
1 answer

How can we specify no route path in UI-Router?

hey @kartik, In order to route to any ...READ MORE

answered 5 days ago in Angular by anonymous
• 3,230 points
12 views
0 votes
1 answer

How can we achieve transclusion in AngularJs?

Hii,  In order to know what transclusion is ...READ MORE

answered Feb 5 in Angular by Niroj
• 3,230 points
14 views