SlideShare a Scribd company logo
Angular Routers
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Agenda
Why Routers?
1
What is Routers?
2
AngularJS Routers
3
Angular Router
4
Demo
6
Diff b/w AngularJS and
Angular Routers
5
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Why we need Routers?
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Why we need Routers?
Navigation Bar
Side Bar Course List
While navigating through a Single Page Application…
Navbar Component
Side Bar Component Course List Component
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Why we need Routers?
Navigation Bar
Side Bar
Course1
Course3
Course4
Course2
If you reload a part (Course List), it only renders that component without fetching the
whole page (i.e. Navigation Bar & Side Bar) from server
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Why we need Routers?
Navigation Bar
Side Bar
Course 2 Description:
… … …
… … …
Similarly, if you select a course, it only renders Course Description instead of reloading
the whole page
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
For a real-time example
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Why we need Routers?
In Gmail inbox while clicking on a mail…
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Why we need Routers?
It only reloads the concerned section, without interfering the rest of the part …
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Without reloading the whole page we can navigate
between components
Thanks to Routers!!!
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
What is Router?
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
What is Router?
Routing is used for navigating among different components in your SPA (Single Page Application)
Component
1
Component
3
Component
6
Component
4
Component
5
Component
2
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
AngularJS Routers
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
AngularJS Routers
NgRoute
UI-Router
UI-Router is a contributed module which is overcome the problems of ngRoute.
Mainly Nested/Complex views.
ngRoute is a angular core module which is good for basic scenarios
• Non official router
• Created by the community
• Used by 99.9% of devs
• More popular than ngRoute
• Mainly used in Nested/Complex views
ANGULARJS
UI-ROUTER
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
UI Route over ng-Route
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
AngularJS Routers
UI-Route over NgRoute
UI-Router allows for nested
views and multiple views
UI-Router allows for you to have
strong-type linking between states
based on state names
You can easily pass information
between states
Change the url in one place will update
every link to that state when you build
your links with ui-sref
States allow you to map and access
different information about different
states
Concept of the decorator in UI-Router,
allows your routes to be dynamically
created based on the URL
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
UI-Router vs NgRoute
Parameters UI-Router NgRoute
Module name (dependent module) ui.router
angular.module('app', ['ui.router']);
ngRoute
angular.module('app', ['ngRoute']);
Router provider $stateProvider
$urlRouterProvider
$routeProvider
Simple Syntax $stateProvider.state('customersState', {
url: '/customers', template: 'My
Customers' })
$routeProvider.when('/customers', {
template: 'My Customers' });
Template view directive ui-view ng-view
Template named view directive ui-view="customers" ---
Link directive ui-sref=""
a ui-sref="customersState"> Customers
</a>
href=""
<a href="#/customers"> Customers
</a>
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
UI-Router vs NgRoute
Parameters UI-Router NgRoute
Getting Params (as a service) $state
(eg) $state.params.id
$stateParams
(eg) $stateParams.id
$route
(eg) $route.current.params.id
$routeParams
(eg) $routeParams.id
Router start event $stateChangeStart $routeChangeStart
Router success event $stateChangeSuccess $routeChangeSuccess
Router error event $stateChangeError $routeChangeError
Router update event --- $routeUpdate
Router not found event $stateNotFound ---
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
UI-Router vs NgRoute
Parameters UI-Router NgRoute
Default View $urlRouterProvider.otherwise('/custom
ers');
$routeProvider.otherwise({redirectTo:
'/customers'});
One view to another view $state.go('customersState'); $location.path( "/customers" );
One view to another view with params $state.go('customersState', {id:'123'}); $location.path( "/customer/123" );
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Angular Router
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Angular Router
• Official Angular Router
• Inspired by the UI-Router
• Complete rewrite as compared to ng-
Route
• Introduction of Route in place of State
ANGULAR
ROUTER
Component
1
Component
3
Component
6
Component
4
Component
5
Component
2
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Router
A router allows us to navigate across components in a Web App
Navbar Component
About Component
Movies Component
Home Component
Home Page View of
the App
It contains the About
section
It shows the list of top 250
movies
Responsible for
navigation among
components
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
A Closer Look at Router
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Router
Path Declaration for different
components
Passing Declared Paths Array to
RouterModule
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
routerLink
Navigation from Movies List Component to Move
Details Component
MoviesComponent MoviesDetailsComponent
[ routerLink ] = “ [ ‘ < path >’ ] ”
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
<router-outlet>
Allows to navigate to a Component
by pasting its path in Browser Address Bar
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
<router-outlet>
Home Page Movies List
Add ‘/movies’ to Browser Address Bar
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Angular Router vs UI-Router
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
UI-Router vs Angular Router
UI ROUTER ANGULAR ROUTER
• A Route in Angular Router
• A Route is the association of a name, a path and
a component
• A State in UI Router
• A State is the association of a name, a url, a
template and a controller
AngularJS Angular
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
UI-Router vs Angular Router
• A Route in Angular Router
• A Route is the association of a name, a path and
a component
• A State in UI Router
• A State is the association of a name, a url, a
template and a controller
UI ROUTER ANGULAR ROUTER
AngularJS Angular
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Nested Views
Navigation Bar
Side Bar
Course1
Course3
Course4
Course2
View inside a view  Course List inside Root Component
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Nested Views
UI ROUTER ANGULAR ROUTER
AngularJS Angular
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Built-in Router Directives
routerLink directive for Angular routerui-sref directive for UI router
UI ROUTER ANGULAR ROUTER
AngularJS Angular
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Built-in Router Directives
routerLink directive for Angular routerui-sref directive for UI router
UI ROUTER ANGULAR ROUTER
AngularJS Angular
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
URL Data
Get the id from /course-details/:id
id of every course
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
URL Data
Get the id from /course-details/:id
RouteParams service for Angular2 Router$stateParams service for UI-Router
id of every course
UI ROUTER ANGULAR ROUTER
AngularJS Angular
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Angular Router Demo
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Demo
Navbar Component
About Component
Course Component
Home Component
Home Page View of
the App
It contains the About
section
It shows the list Edureka
courses
Responsible for navigation
among components
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Demo
Add ‘/course’ to Browser Address Bar
Navigating to Course Detail Component
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Demo
Course Component
(Displays the list of courses)
Navbar Component
Course
Component
About
Component
Course Component
Navbar Component
Course
Component
About
Component
Firebase
Service
Course Details Component
(Displays the details of course selected)
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Thank You …
Questions/Queries/Feedback

More Related Content

What's hot (20)

Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete Guide
Sam Dias
 
Angular 4 fronts
Angular 4 frontsAngular 4 fronts
Angular 4 fronts
badal dubla
 
Developing a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2IDeveloping a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2I
Nader Debbabi
 
Meetup SkillValue - Angular 6 : Bien démarrer son application
Meetup SkillValue - Angular 6 : Bien démarrer son applicationMeetup SkillValue - Angular 6 : Bien démarrer son application
Meetup SkillValue - Angular 6 : Bien démarrer son application
Thibault Even
 
An Overview of Angular 4
An Overview of Angular 4 An Overview of Angular 4
An Overview of Angular 4
Cynoteck Technology Solutions Private Limited
 
What angular 13 will bring to the table
What angular 13 will bring to the table What angular 13 will bring to the table
What angular 13 will bring to the table
Moon Technolabs Pvt. Ltd.
 
Mastering angular - Dot Net Tricks
Mastering angular - Dot Net TricksMastering angular - Dot Net Tricks
Mastering angular - Dot Net Tricks
Gaurav Singh
 
Meetup angular http client
Meetup angular http clientMeetup angular http client
Meetup angular http client
Gaurav Madaan
 
Angular 9 New features
Angular 9 New featuresAngular 9 New features
Angular 9 New features
Ahmed Bouchefra
 
A Glimpse on Angular 4
A Glimpse on Angular 4A Glimpse on Angular 4
A Glimpse on Angular 4
Sam Dias
 
Angular
AngularAngular
Angular
Mouad EL Fakir
 
Angular routing
Angular routingAngular routing
Angular routing
Sultan Ahmed
 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJSOCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
Jonathan Meiss
 
Angular vs. AngularJS: A Complete Comparison Guide
Angular vs. AngularJS: A Complete Comparison GuideAngular vs. AngularJS: A Complete Comparison Guide
Angular vs. AngularJS: A Complete Comparison Guide
Cloud Analogy
 
Angularjs tutorial
Angularjs tutorialAngularjs tutorial
Angularjs tutorial
HarikaReddy115
 
Introduction to angular 4
Introduction to angular 4Introduction to angular 4
Introduction to angular 4
Marwane El Azami
 
Angular 2 - Better or worse
Angular 2 - Better or worseAngular 2 - Better or worse
Angular 2 - Better or worse
Vladimir Georgiev
 
Angular 2
Angular 2Angular 2
Angular 2
Nigam Goyal
 
AngularJS
AngularJSAngularJS
AngularJS
Hiten Pratap Singh
 
Angular js training in noida
Angular js training in noidaAngular js training in noida
Angular js training in noida
nihalsingh113
 
Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete Guide
Sam Dias
 
Angular 4 fronts
Angular 4 frontsAngular 4 fronts
Angular 4 fronts
badal dubla
 
Developing a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2IDeveloping a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2I
Nader Debbabi
 
Meetup SkillValue - Angular 6 : Bien démarrer son application
Meetup SkillValue - Angular 6 : Bien démarrer son applicationMeetup SkillValue - Angular 6 : Bien démarrer son application
Meetup SkillValue - Angular 6 : Bien démarrer son application
Thibault Even
 
Mastering angular - Dot Net Tricks
Mastering angular - Dot Net TricksMastering angular - Dot Net Tricks
Mastering angular - Dot Net Tricks
Gaurav Singh
 
Meetup angular http client
Meetup angular http clientMeetup angular http client
Meetup angular http client
Gaurav Madaan
 
A Glimpse on Angular 4
A Glimpse on Angular 4A Glimpse on Angular 4
A Glimpse on Angular 4
Sam Dias
 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJSOCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
Jonathan Meiss
 
Angular vs. AngularJS: A Complete Comparison Guide
Angular vs. AngularJS: A Complete Comparison GuideAngular vs. AngularJS: A Complete Comparison Guide
Angular vs. AngularJS: A Complete Comparison Guide
Cloud Analogy
 
Angular js training in noida
Angular js training in noidaAngular js training in noida
Angular js training in noida
nihalsingh113
 

Similar to Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | Edureka (20)

Angular js routing options
Angular js routing optionsAngular js routing options
Angular js routing options
Nir Kaufman
 
Intro to UI-Router/TypeScript
Intro to UI-Router/TypeScriptIntro to UI-Router/TypeScript
Intro to UI-Router/TypeScript
Jamal Sinclair O'Garro
 
Deep Dive into AngularJS Javascript Framework
Deep Dive into AngularJS Javascript FrameworkDeep Dive into AngularJS Javascript Framework
Deep Dive into AngularJS Javascript Framework
Edureka!
 
Beyond AngularJS: Best practices and more
Beyond AngularJS: Best practices and moreBeyond AngularJS: Best practices and more
Beyond AngularJS: Best practices and more
Ari Lerner
 
ngNewRouter
ngNewRouterngNewRouter
ngNewRouter
phidong
 
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptxUQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
TamalDey28
 
Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2
Knoldus Inc.
 
Angular2 routing
Angular2 routingAngular2 routing
Angular2 routing
TejinderMakkar
 
Building Better Web Apps with Angular.js (SXSW 2014)
Building Better Web Apps with Angular.js (SXSW 2014)Building Better Web Apps with Angular.js (SXSW 2014)
Building Better Web Apps with Angular.js (SXSW 2014)
kbekessy
 
How routing works in angular js
How routing works in angular jsHow routing works in angular js
How routing works in angular js
codeandyou forums
 
UI-Router
UI-RouterUI-Router
UI-Router
Loc Nguyen
 
Understand routing in angular 2
Understand routing in angular 2Understand routing in angular 2
Understand routing in angular 2
codeandyou forums
 
Angularjs
AngularjsAngularjs
Angularjs
Ynon Perek
 
Angular 4 Tutorial For Beginners | Angular 4 Introduction | Angular 4 Trainin...
Angular 4 Tutorial For Beginners | Angular 4 Introduction | Angular 4 Trainin...Angular 4 Tutorial For Beginners | Angular 4 Introduction | Angular 4 Trainin...
Angular 4 Tutorial For Beginners | Angular 4 Introduction | Angular 4 Trainin...
Edureka!
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
Katy Slemon
 
AngularJS for Beginners
AngularJS for BeginnersAngularJS for Beginners
AngularJS for Beginners
Edureka!
 
ngconf2015
ngconf2015ngconf2015
ngconf2015
Anne Cypcar
 
Angular JS Routing
Angular JS RoutingAngular JS Routing
Angular JS Routing
kennystoltz
 
AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)
Abhishek Anand
 
Getting Started with AngularJS
Getting Started with AngularJSGetting Started with AngularJS
Getting Started with AngularJS
Edureka!
 
Angular js routing options
Angular js routing optionsAngular js routing options
Angular js routing options
Nir Kaufman
 
Deep Dive into AngularJS Javascript Framework
Deep Dive into AngularJS Javascript FrameworkDeep Dive into AngularJS Javascript Framework
Deep Dive into AngularJS Javascript Framework
Edureka!
 
Beyond AngularJS: Best practices and more
Beyond AngularJS: Best practices and moreBeyond AngularJS: Best practices and more
Beyond AngularJS: Best practices and more
Ari Lerner
 
ngNewRouter
ngNewRouterngNewRouter
ngNewRouter
phidong
 
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptxUQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
TamalDey28
 
Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2
Knoldus Inc.
 
Building Better Web Apps with Angular.js (SXSW 2014)
Building Better Web Apps with Angular.js (SXSW 2014)Building Better Web Apps with Angular.js (SXSW 2014)
Building Better Web Apps with Angular.js (SXSW 2014)
kbekessy
 
How routing works in angular js
How routing works in angular jsHow routing works in angular js
How routing works in angular js
codeandyou forums
 
Understand routing in angular 2
Understand routing in angular 2Understand routing in angular 2
Understand routing in angular 2
codeandyou forums
 
Angular 4 Tutorial For Beginners | Angular 4 Introduction | Angular 4 Trainin...
Angular 4 Tutorial For Beginners | Angular 4 Introduction | Angular 4 Trainin...Angular 4 Tutorial For Beginners | Angular 4 Introduction | Angular 4 Trainin...
Angular 4 Tutorial For Beginners | Angular 4 Introduction | Angular 4 Trainin...
Edureka!
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
Katy Slemon
 
AngularJS for Beginners
AngularJS for BeginnersAngularJS for Beginners
AngularJS for Beginners
Edureka!
 
Angular JS Routing
Angular JS RoutingAngular JS Routing
Angular JS Routing
kennystoltz
 
AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)
Abhishek Anand
 
Getting Started with AngularJS
Getting Started with AngularJSGetting Started with AngularJS
Getting Started with AngularJS
Edureka!
 
Ad

More from Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
Edureka!
 
What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
Edureka!
 
Ad

Recently uploaded (20)

“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptxFIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdfHigh Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUEIntroduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptxFIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Data Validation and System Interoperability
Data Validation and System InteroperabilityData Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptxFIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptxFIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdfHigh Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptxFIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Data Validation and System Interoperability
Data Validation and System InteroperabilityData Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptxFIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 

Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | Edureka

  • 2. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Agenda Why Routers? 1 What is Routers? 2 AngularJS Routers 3 Angular Router 4 Demo 6 Diff b/w AngularJS and Angular Routers 5
  • 3. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Why we need Routers?
  • 4. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Why we need Routers? Navigation Bar Side Bar Course List While navigating through a Single Page Application… Navbar Component Side Bar Component Course List Component
  • 5. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Why we need Routers? Navigation Bar Side Bar Course1 Course3 Course4 Course2 If you reload a part (Course List), it only renders that component without fetching the whole page (i.e. Navigation Bar & Side Bar) from server
  • 6. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Why we need Routers? Navigation Bar Side Bar Course 2 Description: … … … … … … Similarly, if you select a course, it only renders Course Description instead of reloading the whole page
  • 7. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js For a real-time example
  • 8. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Why we need Routers? In Gmail inbox while clicking on a mail…
  • 9. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Why we need Routers? It only reloads the concerned section, without interfering the rest of the part …
  • 10. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Without reloading the whole page we can navigate between components Thanks to Routers!!!
  • 11. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js What is Router?
  • 12. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js What is Router? Routing is used for navigating among different components in your SPA (Single Page Application) Component 1 Component 3 Component 6 Component 4 Component 5 Component 2
  • 13. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js AngularJS Routers
  • 14. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js AngularJS Routers NgRoute UI-Router UI-Router is a contributed module which is overcome the problems of ngRoute. Mainly Nested/Complex views. ngRoute is a angular core module which is good for basic scenarios • Non official router • Created by the community • Used by 99.9% of devs • More popular than ngRoute • Mainly used in Nested/Complex views ANGULARJS UI-ROUTER
  • 15. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js UI Route over ng-Route
  • 16. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js AngularJS Routers UI-Route over NgRoute UI-Router allows for nested views and multiple views UI-Router allows for you to have strong-type linking between states based on state names You can easily pass information between states Change the url in one place will update every link to that state when you build your links with ui-sref States allow you to map and access different information about different states Concept of the decorator in UI-Router, allows your routes to be dynamically created based on the URL
  • 17. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js UI-Router vs NgRoute Parameters UI-Router NgRoute Module name (dependent module) ui.router angular.module('app', ['ui.router']); ngRoute angular.module('app', ['ngRoute']); Router provider $stateProvider $urlRouterProvider $routeProvider Simple Syntax $stateProvider.state('customersState', { url: '/customers', template: 'My Customers' }) $routeProvider.when('/customers', { template: 'My Customers' }); Template view directive ui-view ng-view Template named view directive ui-view="customers" --- Link directive ui-sref="" a ui-sref="customersState"> Customers </a> href="" <a href="#/customers"> Customers </a>
  • 18. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js UI-Router vs NgRoute Parameters UI-Router NgRoute Getting Params (as a service) $state (eg) $state.params.id $stateParams (eg) $stateParams.id $route (eg) $route.current.params.id $routeParams (eg) $routeParams.id Router start event $stateChangeStart $routeChangeStart Router success event $stateChangeSuccess $routeChangeSuccess Router error event $stateChangeError $routeChangeError Router update event --- $routeUpdate Router not found event $stateNotFound ---
  • 19. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js UI-Router vs NgRoute Parameters UI-Router NgRoute Default View $urlRouterProvider.otherwise('/custom ers'); $routeProvider.otherwise({redirectTo: '/customers'}); One view to another view $state.go('customersState'); $location.path( "/customers" ); One view to another view with params $state.go('customersState', {id:'123'}); $location.path( "/customer/123" );
  • 20. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Angular Router
  • 21. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Angular Router • Official Angular Router • Inspired by the UI-Router • Complete rewrite as compared to ng- Route • Introduction of Route in place of State ANGULAR ROUTER Component 1 Component 3 Component 6 Component 4 Component 5 Component 2
  • 22. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Router A router allows us to navigate across components in a Web App Navbar Component About Component Movies Component Home Component Home Page View of the App It contains the About section It shows the list of top 250 movies Responsible for navigation among components
  • 23. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js A Closer Look at Router
  • 24. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Router Path Declaration for different components Passing Declared Paths Array to RouterModule
  • 25. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js routerLink Navigation from Movies List Component to Move Details Component MoviesComponent MoviesDetailsComponent [ routerLink ] = “ [ ‘ < path >’ ] ”
  • 26. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js <router-outlet> Allows to navigate to a Component by pasting its path in Browser Address Bar
  • 27. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js <router-outlet> Home Page Movies List Add ‘/movies’ to Browser Address Bar
  • 28. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Angular Router vs UI-Router
  • 29. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js UI-Router vs Angular Router UI ROUTER ANGULAR ROUTER • A Route in Angular Router • A Route is the association of a name, a path and a component • A State in UI Router • A State is the association of a name, a url, a template and a controller AngularJS Angular
  • 30. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js UI-Router vs Angular Router • A Route in Angular Router • A Route is the association of a name, a path and a component • A State in UI Router • A State is the association of a name, a url, a template and a controller UI ROUTER ANGULAR ROUTER AngularJS Angular
  • 31. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Nested Views Navigation Bar Side Bar Course1 Course3 Course4 Course2 View inside a view  Course List inside Root Component
  • 32. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Nested Views UI ROUTER ANGULAR ROUTER AngularJS Angular
  • 33. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Built-in Router Directives routerLink directive for Angular routerui-sref directive for UI router UI ROUTER ANGULAR ROUTER AngularJS Angular
  • 34. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Built-in Router Directives routerLink directive for Angular routerui-sref directive for UI router UI ROUTER ANGULAR ROUTER AngularJS Angular
  • 35. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js URL Data Get the id from /course-details/:id id of every course
  • 36. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js URL Data Get the id from /course-details/:id RouteParams service for Angular2 Router$stateParams service for UI-Router id of every course UI ROUTER ANGULAR ROUTER AngularJS Angular
  • 37. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Angular Router Demo
  • 38. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Demo Navbar Component About Component Course Component Home Component Home Page View of the App It contains the About section It shows the list Edureka courses Responsible for navigation among components
  • 39. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Demo Add ‘/course’ to Browser Address Bar Navigating to Course Detail Component
  • 40. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Demo Course Component (Displays the list of courses) Navbar Component Course Component About Component Course Component Navbar Component Course Component About Component Firebase Service Course Details Component (Displays the details of course selected)
  • 41. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Thank You … Questions/Queries/Feedback