SlideShare uma empresa Scribd logo
1 de 6
How routing works in
AngularJs
In Angular$stateProviderisuse formaintainstate of application.$stateProvidermainlyfocuson
navigationof application.state maintainviacontroller,template andview .Itsworkviastate hierarchy
and can be have nestedstates.
State configuredintoapplicationconfigurationsections.
$stateProviderdependenton $urlRouterProviderand$urlMatcherFactoryProvider.
In thisexample youwillsee howtouse $stateProviderinAngularJs.
In thisdemowe are usingfour .html pages.
index.html - main page
aboutUs.html
contactUs.html
queryString.html - page where catching state parameters
Demo - Indemowe have four linkwithhref
Home - #/
AboutUs - #aboutUs
Contact Us - #contactUs
Query String - #queryString/1001
Whenuserclickon these linksstate will be matchandrelatedcontrollerandview willbe load
$stateProvider.state("home", {
url: "/",
template: '<h5> This is home Page </h5>'
}).state('aboutUs', {
url: '/aboutUs',
templateUrl: "aboutUs.html",
}).state('contactUs', {
url: '/contactUs',
templateUrl: "contactUs.html",
}).state('queryString', {
url: '/queryString/:id',
templateUrl: "queryString.html",
controller: 'TestController'
});
Plunker - http://plnkr.co/edit/ZY9HSGR8TCtQFycJytuF?p=preview
index.html
<!DOCTYPE html>
<html>
<head>
<title>How routing works in AngularJs </title>
<link rel="stylesheet"
href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css">
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.4/angular.js"></scri
pt>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-
router/0.2.15/angular-ui-router.js"></script>
<script>
var app = angular.module('queryStringApp', ['ui.router']);
app.config(['$stateProvider', '$urlRouterProvider', function
($stateProvider, $urlRouterProvider) {
$stateProvider.state("home", {
url: "/",
template: '<h5> This is home Page </h5>'
}).state('aboutUs', {
url: '/aboutUs',
templateUrl: "aboutUs.html",
}).state('contactUs', {
url: '/contactUs',
templateUrl: "contactUs.html",
}).state('queryString', {
url: '/queryString/:id',
templateUrl: "queryString.html",
controller: 'TestController'
});
}]);
app.controller('TestController', function ($scope, $stateParams) {
$scope.IDValue = $stateParams.id;
});
</script>
</head>
<body ng-app="queryStringApp">
<hr> <a href="#/">Home</a> <a href="#aboutUs">About Us</a> <a
href="#contactUs">Contact Us</a> <a href="#queryString/1001">Query String</a>
<hr>
<div ui-view class="container slide"></div>
<br /><br /><br /><br /><br />
<div style="background-color:lightgray">
<p>
Learn More about UI-router
<a href="https://github.com/angular-ui/ui-router "
target="_blank">https://github.com/angular-ui/ui-router</a>
</p>
<br />
<div>
<h4> Fix Following problem in $stateProvider </h4>
<h5> Fix $stateProvider returns "not found " problem </h5>
<h5>Uncaught ReferenceError: $stateProvider is not defined
Angular UI Router </h5>
<h5>angularjs ui-router: Unknown provider: $stateProvider </h5>
</div>
</div>
</body>
</html>
aboutUs.html
<h5>About Us View</h5>
contactUs.html
<h5>Contact Us View</h5>
queryString.html
<h5> Queery String View</h4>
<div ng-controller="TestController" >
Id value - {{IDValue}}
</div>
Thanks
www.codeandyou.com
http://www.codeandyou.com/2015/09/how-routing-
works-in-angularjs.html
Keywords - How routing works in AngularJs, Routing in AngularJs

Mais conteúdo relacionado

Mais procurados

Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
Wei Ru
 
Анатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to zАнатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to z
LEDC 2016
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of today
gerbille
 

Mais procurados (20)

AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives
 
Dive into AngularJS Routing
Dive into AngularJS RoutingDive into AngularJS Routing
Dive into AngularJS Routing
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationAngular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
 
Dart and AngularDart
Dart and AngularDartDart and AngularDart
Dart and AngularDart
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 
Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJS
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIWorkshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte II
 
Workshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJSWorkshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJS
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
Built in filters
Built in filtersBuilt in filters
Built in filters
 
Controller in AngularJS
Controller in AngularJSController in AngularJS
Controller in AngularJS
 
Angular js
Angular jsAngular js
Angular js
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
 
CFUGbe talk about Angular JS
CFUGbe talk about Angular JSCFUGbe talk about Angular JS
CFUGbe talk about Angular JS
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
 
Анатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to zАнатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to z
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of today
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte I
 

Semelhante a How routing works in angular js

Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
Tuna Tore
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892
Tuna Tore
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
haruki ueno
 

Semelhante a How routing works in angular js (20)

AngularJS Basic Training
AngularJS Basic TrainingAngularJS Basic Training
AngularJS Basic Training
 
Angular data binding by Soft Solutions4U
Angular data binding by Soft Solutions4UAngular data binding by Soft Solutions4U
Angular data binding by Soft Solutions4U
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
 
Starting with angular js
Starting with angular js Starting with angular js
Starting with angular js
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892
 
Angular presentation
Angular presentationAngular presentation
Angular presentation
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Angular Tutorial Freshers and Experienced
Angular Tutorial Freshers and ExperiencedAngular Tutorial Freshers and Experienced
Angular Tutorial Freshers and Experienced
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
 
Introduction to AngularJS By Bharat Makwana
Introduction to AngularJS By Bharat MakwanaIntroduction to AngularJS By Bharat Makwana
Introduction to AngularJS By Bharat Makwana
 
Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
Angular directive filter and routing
Angular directive filter and routingAngular directive filter and routing
Angular directive filter and routing
 
AngularJS & Drupal - Андрей Березовский
AngularJS & Drupal - Андрей БерезовскийAngularJS & Drupal - Андрей Березовский
AngularJS & Drupal - Андрей Березовский
 
Angular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решенияAngular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решения
 
Patterns Are Good For Managers
Patterns Are Good For ManagersPatterns Are Good For Managers
Patterns Are Good For Managers
 
The Rails Way
The Rails WayThe Rails Way
The Rails Way
 
Building Dynamic Navigation in your Rails 4 Layout
Building Dynamic Navigation in your Rails 4 LayoutBuilding Dynamic Navigation in your Rails 4 Layout
Building Dynamic Navigation in your Rails 4 Layout
 

Mais de codeandyou forums

Mais de codeandyou forums (17)

How to validate server certificate
How to validate server certificateHow to validate server certificate
How to validate server certificate
 
How to call $scope function from console
How to call $scope function from consoleHow to call $scope function from console
How to call $scope function from console
 
Understand components in Angular 2
Understand components in Angular 2Understand components in Angular 2
Understand components in Angular 2
 
Understand routing in angular 2
Understand routing in angular 2Understand routing in angular 2
Understand routing in angular 2
 
How to setup ionic 2
How to setup ionic 2How to setup ionic 2
How to setup ionic 2
 
MongoDB 3.2.0 Released
MongoDB 3.2.0 ReleasedMongoDB 3.2.0 Released
MongoDB 3.2.0 Released
 
Welcome to ionic 2
Welcome to ionic 2Welcome to ionic 2
Welcome to ionic 2
 
What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?
What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?
What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?
 
How to install ssl certificate from .pem
How to install ssl certificate from .pemHow to install ssl certificate from .pem
How to install ssl certificate from .pem
 
Protractor end-to-end testing framework for angular js
Protractor   end-to-end testing framework for angular jsProtractor   end-to-end testing framework for angular js
Protractor end-to-end testing framework for angular js
 
How to use proxy server in .net application
How to use proxy server in .net applicationHow to use proxy server in .net application
How to use proxy server in .net application
 
How to catch query string in angular js
How to catch query string in angular jsHow to catch query string in angular js
How to catch query string in angular js
 
Different way to share data between controllers in angular js
Different way to share data between controllers in angular jsDifferent way to share data between controllers in angular js
Different way to share data between controllers in angular js
 
Angular.js interview questions
Angular.js interview questionsAngular.js interview questions
Angular.js interview questions
 
How to set up a proxy server on windows
How to set up a proxy server on windows How to set up a proxy server on windows
How to set up a proxy server on windows
 
What is $root scope in angularjs
What is $root scope in angularjsWhat is $root scope in angularjs
What is $root scope in angularjs
 
How to save log4net into database
How to save log4net into databaseHow to save log4net into database
How to save log4net into database
 

Último

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Último (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

How routing works in angular js

  • 1. How routing works in AngularJs
  • 2. In Angular$stateProviderisuse formaintainstate of application.$stateProvidermainlyfocuson navigationof application.state maintainviacontroller,template andview .Itsworkviastate hierarchy and can be have nestedstates. State configuredintoapplicationconfigurationsections. $stateProviderdependenton $urlRouterProviderand$urlMatcherFactoryProvider. In thisexample youwillsee howtouse $stateProviderinAngularJs. In thisdemowe are usingfour .html pages. index.html - main page aboutUs.html contactUs.html queryString.html - page where catching state parameters Demo - Indemowe have four linkwithhref Home - #/ AboutUs - #aboutUs Contact Us - #contactUs Query String - #queryString/1001 Whenuserclickon these linksstate will be matchandrelatedcontrollerandview willbe load $stateProvider.state("home", { url: "/", template: '<h5> This is home Page </h5>' }).state('aboutUs', { url: '/aboutUs', templateUrl: "aboutUs.html", }).state('contactUs', { url: '/contactUs', templateUrl: "contactUs.html", }).state('queryString', { url: '/queryString/:id', templateUrl: "queryString.html", controller: 'TestController' }); Plunker - http://plnkr.co/edit/ZY9HSGR8TCtQFycJytuF?p=preview
  • 3.
  • 4. index.html <!DOCTYPE html> <html> <head> <title>How routing works in AngularJs </title> <link rel="stylesheet" href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css"> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.4/angular.js"></scri pt> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui- router/0.2.15/angular-ui-router.js"></script> <script> var app = angular.module('queryStringApp', ['ui.router']);
  • 5. app.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) { $stateProvider.state("home", { url: "/", template: '<h5> This is home Page </h5>' }).state('aboutUs', { url: '/aboutUs', templateUrl: "aboutUs.html", }).state('contactUs', { url: '/contactUs', templateUrl: "contactUs.html", }).state('queryString', { url: '/queryString/:id', templateUrl: "queryString.html", controller: 'TestController' }); }]); app.controller('TestController', function ($scope, $stateParams) { $scope.IDValue = $stateParams.id; }); </script> </head> <body ng-app="queryStringApp"> <hr> <a href="#/">Home</a> <a href="#aboutUs">About Us</a> <a href="#contactUs">Contact Us</a> <a href="#queryString/1001">Query String</a> <hr> <div ui-view class="container slide"></div> <br /><br /><br /><br /><br /> <div style="background-color:lightgray"> <p> Learn More about UI-router <a href="https://github.com/angular-ui/ui-router " target="_blank">https://github.com/angular-ui/ui-router</a> </p> <br /> <div> <h4> Fix Following problem in $stateProvider </h4> <h5> Fix $stateProvider returns "not found " problem </h5> <h5>Uncaught ReferenceError: $stateProvider is not defined Angular UI Router </h5> <h5>angularjs ui-router: Unknown provider: $stateProvider </h5> </div> </div> </body> </html> aboutUs.html
  • 6. <h5>About Us View</h5> contactUs.html <h5>Contact Us View</h5> queryString.html <h5> Queery String View</h4> <div ng-controller="TestController" > Id value - {{IDValue}} </div> Thanks www.codeandyou.com http://www.codeandyou.com/2015/09/how-routing- works-in-angularjs.html Keywords - How routing works in AngularJs, Routing in AngularJs