SlideShare a Scribd company logo
-Santosh Kumar Kar
What is AngularJS
• JavaScript MVC framework for the Web
• pure JavaScript and HTML
• Unit Testable
• For Web and Mobile
• Less code
• Can integrate 3rd party libraries such as jQueryUI/BootStrap
MVC
• The model is the driving force of the application. This is generally the
data behind the application, usually fetched from the server. Any UI
with data that the user sees is derived from the model, or a subset of
the model.
• The view is the UI that the user sees and interacts with. It is dynamic,
and generated based on the current model of the application
• The controller is the business logic and presentation layer, which
performs actions such as fetching data, and makes decisions such as
how to present the model, which parts of it to display, etc.
First Application ng-app
Task – 1
• Write a Angular Application which prints the value of below
expressions:
• 5 *5 + 2*2
• 10/5*2-100
AngularJS Directives
• Markers on DOM elements (such as elements, attributes, css, and
more).
• Used to create custom HTML tags that serve as new, custom widgets.
• AngularJS has built-in directives (ngBind, ngModel...)
directive
ng-app
• first and most important directive
• Tells the section of HTML that AngularJS controls
• Need to put in any tag, preferable at <html> or <body>
• Anything outside of the tag would not be processed
directive
ng-model, ng-bind
directive
ng-model
• used with input fields, user to enter any data and get access to the
value in JavaScript.
• In ng-model="n1", AngularJS stores the value that the user types into
in a variable called "n1"
directive
ng-bind
• Binds with the Angular JS variable
• ng-bind in <span>
<span ng-bind="n1"
is similar to
{{n1}}
Modules
• Modules in AngularJS are similar to packages in java
• Container for the different parts of your app – controllers, services,
filters, directives, etc.
• Can define its own controllers, services, factories, and directives
which are accessed throughout the module.
• Can depend on other modules as dependencies and made available to
all the code defined in this module.
• angular.module(‘myApp', []);
Creating a module with no dependencies
• angular.module(‘myApp', ['myapp.ui', 'yourapp.diagram']);
Creating a module with 2 other dependent modules
• angular.module(‘myApp');
• looks an existing module to make it available to use, add, or modify in the
current file.
Module name we
define
Array of dependent
modules
Modules
Controller
• Fetch data from the server for UI
• Are regular JavaScript Objects.
• ng-controller directive defines the application controller.
Parent module
Child modules
Defined 2 Controllers
Using parent module
only
Task – 2
• Write an Angular Application which prints current date and time on
the screen
controllerAs
• Can be used in AngularJS 1.2 and later
• Allows to define the variables on the controller instance using the this
keyword instead of $scope
• Directly can be referred through the controller from the HTML
controllerAs
$scope.name = 'some value'
changed to
this.name = 'some value';
ng-controller="EmpController"
changed to
ng-controller="EmpController as emp"
{{ name }}
changed to
{{ emp.name }}
Angular js for Beginnners
directive
ng-repeat
• Similar to for each loop
• Allows to iterate over an array
• Allows to iterate over keys and values of an object
• Syntax: ng-repeat="eachVar in arrayVar"
Angular js for Beginnners
Calculator
Task – 3
• Write an Angular Application as
• Create a list which stores value of 5 students (id, name, marks) in a school
• In HTML, print the name and marks of all the students.
Calculator
Calculator
Forms
• ng-submit
• ng-disabled = "myForm.$invalid"
• required
form
JS
Task – 4
• Write an Angular Application
• Add few controls with different validation
• Add a submit button in the form.
• Submit button should be enabled only when all the validations are passed.
Error Handling
• Form validation
• required
• ng-required
• ng-minlength
• ng-maxlength
• ng-pattern
• type="email"
• type="number"
• type="date"
• type="url"
Dependency
Injection
• Any service known to
AngularJS can be injected into
any other service, directive,
or controller by stating it as a
dependency.
• AngularJS will automatically
create the entire chain before
injecting.
Controller vs Services
Services
• Service that is a reusable API or substitutable objects, which can be
shared across our applications.
• A service in AngularJS can be implemented as a
• factory
• service
• provider
Service types
• Build-in
• Custom
Common built-In Services
• $window
• $log
• $http
• $location
• $timeout
• $interval
Points to remember:
• AngularJS prefixes all the services that are provided by the AngularJS library with the $ sign.
• when you create your own services, do not prefix them with a $ sign. It will just end up confusing
you and your team at some point in time
Injecting service
Order of Injection
Creating Our Own Service
Creating your own service
Data with $http
• Similar to request to the server from AJAX applications (using
XMLHttpRequests)
• Makes request
• reads response
• checks the error codes
• processes the server response
• Traditional
• var xmlhttp = new XMLHttpRequest();
• xmlhttp.open("GET", "http://myserver/api", true);
Few test cases:
Input: 1, output: 1
Input:10, output: A
Input:15, output: F
Task – 5
• Write a Angular Application
• Add a service, this will take a decimal number as input and print the
hexadecimal value of that number.
$http with REST APIs
• GET
• HEAD
• POST
• DELETE
• PUT
• JSONP
GET request
Task – 6
• Write a Angular Application
• Which consumes restful web-service with GET, POST, DELETE
(you can write a web-service or see some examples with node.js to create demo restful web-
service)
Unit Testing
Filters
• Process data and format values to present
• Applied on expressions in HTML
• Applied directly on data in our controllers and services
• Examples:
• Format timestamp to readable date string
• Add currency symbol on a number
Angular js for Beginnners
Task – 7
• Write a Angular Application
• Use in-built filters and produce the below output
(you can write a web-service or see some examples with node.js to create demo restful web-
service)
Task – 8
• Write a Angular Application and use below built-in filters
• orderBy
• filter
• json
• limitTo
Custom Filters
Task – 8
• Write a custom filter which accepts a string value and prints every
alternate character in lower case preceding to a upper case character.
Test cases:
Input: AngularJS output:AnGuLaRjS
Filters in controllers
Routing with URL - myurl.html#/home
• You need Routing if
• we call hashbang URLs, not the standard URL
• You are developing a single page application
• You have multiple views for a single page (e.g. Home Page, About Us, Contact
Us etc.)
• For each request in a single page, you need to load one of the view as
presentation logic but you don’t want to refresh the page.
• You don’t need to load the whole page but only the contents of the view
• You need speed response by loading contents faster
Routing: how to code
• Import angular.js and angular-route.js
• Use dependancy model to ngRoute
var myvar = angular.module('org',['ngRoute']);
• Config the route provider
$routeProvider.when(url, {
template: string,
templateUrl: string,
controller: string, function or array,
controllerAs: string,
resolve: object<key, function>
});
Angular js for Beginnners
Request in routing : ‘#’ factor
• Request in a common URLs:
# in URLs
Task – 9
Make 3 Angular applications (3 views)
• Home.html
• About.html
• Contact.html
In index.html, you need to define 3 links for home, about and contact.
On clicking the links it needs to route to respective views without
reloading the page.
(Note: You may need to deploy as an application in a server to make it work.)
Things to do:
• I didn’t cover the unit testing parts in AngularJS along with mocking
up in this presentation for each of the components. I request you to
go through the steps for unit testing in internet. If I get time I would
add unit testing in a separate presentation. Thank you.
Angular js for Beginnners
Source Code at:
• https://github.com/santoshkar/Angular.git
Angular js for Beginnners

More Related Content

PPTX
Moving From AngularJS to Angular 2
Exilesoft
 
PPTX
Angular js 1.0-fundamentals
Venkatesh Narayanan
 
PDF
JavaLand 2014 - Ankor.io Presentation
manolitto
 
PDF
jQuery - Chapter 1 - Introduction
WebStackAcademy
 
PDF
[2015/2016] Require JS and Handlebars JS
Ivano Malavolta
 
PPTX
Ankor Presentation @ JavaOne San Francisco September 2014
manolitto
 
PPTX
Angular js
Baldeep Sohal
 
Moving From AngularJS to Angular 2
Exilesoft
 
Angular js 1.0-fundamentals
Venkatesh Narayanan
 
JavaLand 2014 - Ankor.io Presentation
manolitto
 
jQuery - Chapter 1 - Introduction
WebStackAcademy
 
[2015/2016] Require JS and Handlebars JS
Ivano Malavolta
 
Ankor Presentation @ JavaOne San Francisco September 2014
manolitto
 
Angular js
Baldeep Sohal
 

What's hot (20)

PPTX
Front end development with Angular JS
Bipin
 
PDF
MVC 1.0 als alternative Webtechnologie
OPEN KNOWLEDGE GmbH
 
PPTX
Introduction to single page application with angular js
Mindfire Solutions
 
PDF
[2015/2016] JavaScript
Ivano Malavolta
 
PPTX
Comparing Angular and React JS for SPAs
Jennifer Estrada
 
PPTX
angularJs Workshop
Ran Wahle
 
PPTX
MVC Training Part 1
Lee Englestone
 
PPT
Mvc architecture
Surbhi Panhalkar
 
PDF
Angular - Chapter 3 - Components
WebStackAcademy
 
PPTX
Angular Data Binding
Jennifer Estrada
 
PDF
Angular - Chapter 5 - Directives
WebStackAcademy
 
ODP
Introduction to Knockout Js
Knoldus Inc.
 
PPTX
Object Oriented Programing in JavaScript
Akshay Mathur
 
PPT
ASP .net MVC
Divya Sharma
 
PDF
jQuery
Ivano Malavolta
 
PDF
jQuery and Rails: Best Friends Forever
stephskardal
 
PPTX
ASP .NET MVC
eldorina
 
PDF
[2015/2016] Local data storage for web-based mobile apps
Ivano Malavolta
 
PPTX
ASP.NET MVC 5 - EF 6 - VS2015
Hossein Zahed
 
PDF
Viper
Jacob Van Brunt
 
Front end development with Angular JS
Bipin
 
MVC 1.0 als alternative Webtechnologie
OPEN KNOWLEDGE GmbH
 
Introduction to single page application with angular js
Mindfire Solutions
 
[2015/2016] JavaScript
Ivano Malavolta
 
Comparing Angular and React JS for SPAs
Jennifer Estrada
 
angularJs Workshop
Ran Wahle
 
MVC Training Part 1
Lee Englestone
 
Mvc architecture
Surbhi Panhalkar
 
Angular - Chapter 3 - Components
WebStackAcademy
 
Angular Data Binding
Jennifer Estrada
 
Angular - Chapter 5 - Directives
WebStackAcademy
 
Introduction to Knockout Js
Knoldus Inc.
 
Object Oriented Programing in JavaScript
Akshay Mathur
 
ASP .net MVC
Divya Sharma
 
jQuery and Rails: Best Friends Forever
stephskardal
 
ASP .NET MVC
eldorina
 
[2015/2016] Local data storage for web-based mobile apps
Ivano Malavolta
 
ASP.NET MVC 5 - EF 6 - VS2015
Hossein Zahed
 
Ad

Similar to Angular js for Beginnners (20)

PPTX
AngularJS One Day Workshop
Shyam Seshadri
 
PPTX
AngularJS Introduction (Talk given on Aug 5 2013)
Abhishek Anand
 
PDF
AngularJS Basics and Best Practices - CC FE &UX
JWORKS powered by Ordina
 
PPTX
Angular workshop - Full Development Guide
Nitin Giri
 
PPTX
Learning AngularJS - Complete coverage of AngularJS features and concepts
Suresh Patidar
 
PPT
Angular js
Hritesh Saha
 
PPTX
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
murtazahaveliwala
 
PPTX
Angular Presentation
Adam Moore
 
PDF
AngularJS Workshop
Gianluca Cacace
 
PPTX
Intoduction to Angularjs
Gaurav Agrawal
 
PPT
Introduction to AngularJS
Anass90
 
PPTX
Training On Angular Js
Mahima Radhakrishnan
 
PPT
Angularjs for kolkata drupal meetup
Goutam Dey
 
PPTX
AngularJS is awesome
Eusebiu Schipor
 
PDF
AngularJS Beginner Day One
Troy Miles
 
PPTX
Kalp Corporate Angular Js Tutorials
Kalp Corporate
 
PPT
Angular js
yogi_solanki
 
PDF
One Weekend With AngularJS
Yashobanta Bai
 
PPTX
ME vs WEB - AngularJS Fundamentals
Aviran Cohen
 
AngularJS One Day Workshop
Shyam Seshadri
 
AngularJS Introduction (Talk given on Aug 5 2013)
Abhishek Anand
 
AngularJS Basics and Best Practices - CC FE &UX
JWORKS powered by Ordina
 
Angular workshop - Full Development Guide
Nitin Giri
 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Suresh Patidar
 
Angular js
Hritesh Saha
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
murtazahaveliwala
 
Angular Presentation
Adam Moore
 
AngularJS Workshop
Gianluca Cacace
 
Intoduction to Angularjs
Gaurav Agrawal
 
Introduction to AngularJS
Anass90
 
Training On Angular Js
Mahima Radhakrishnan
 
Angularjs for kolkata drupal meetup
Goutam Dey
 
AngularJS is awesome
Eusebiu Schipor
 
AngularJS Beginner Day One
Troy Miles
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate
 
Angular js
yogi_solanki
 
One Weekend With AngularJS
Yashobanta Bai
 
ME vs WEB - AngularJS Fundamentals
Aviran Cohen
 
Ad

More from Santosh Kumar Kar (11)

PPTX
Smart home arduino
Santosh Kumar Kar
 
PPTX
Operating electrical devices with PIR sensor. No coding, No controller
Santosh Kumar Kar
 
PPTX
Temperature sensor with raspberry pi
Santosh Kumar Kar
 
PPTX
Pir motion sensor with raspberry pi
Santosh Kumar Kar
 
PPTX
Raspberry pi complete setup
Santosh Kumar Kar
 
PPTX
Introduction to spring boot
Santosh Kumar Kar
 
PPTX
Spring transaction part4
Santosh Kumar Kar
 
PPTX
Spring & hibernate
Santosh Kumar Kar
 
PPTX
Spring database - part2
Santosh Kumar Kar
 
PPTX
Springs
Santosh Kumar Kar
 
PPTX
Writing simple web services in java using eclipse editor
Santosh Kumar Kar
 
Smart home arduino
Santosh Kumar Kar
 
Operating electrical devices with PIR sensor. No coding, No controller
Santosh Kumar Kar
 
Temperature sensor with raspberry pi
Santosh Kumar Kar
 
Pir motion sensor with raspberry pi
Santosh Kumar Kar
 
Raspberry pi complete setup
Santosh Kumar Kar
 
Introduction to spring boot
Santosh Kumar Kar
 
Spring transaction part4
Santosh Kumar Kar
 
Spring & hibernate
Santosh Kumar Kar
 
Spring database - part2
Santosh Kumar Kar
 
Writing simple web services in java using eclipse editor
Santosh Kumar Kar
 

Recently uploaded (20)

PPTX
Materi_Pemrograman_Komputer-Looping.pptx
RanuFajar1
 
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PDF
Solar Panel Installation Guide – Step By Step Process 2025.pdf
CRMLeaf
 
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
PDF
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
PDF
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
DOCX
The Five Best AI Cover Tools in 2025.docx
aivoicelabofficial
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PPTX
TestNG for Java Testing and Automation testing
ssuser0213cb
 
PPTX
EU POPs Limits & Digital Product Passports Compliance Strategy 2025.pptx
Certivo Inc
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
DOCX
The Future of Smart Factories Why Embedded Analytics Leads the Way
Varsha Nayak
 
PDF
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
Materi_Pemrograman_Komputer-Looping.pptx
RanuFajar1
 
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
Solar Panel Installation Guide – Step By Step Process 2025.pdf
CRMLeaf
 
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
The Five Best AI Cover Tools in 2025.docx
aivoicelabofficial
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
oapresentation.pptx
mehatdhavalrajubhai
 
TestNG for Java Testing and Automation testing
ssuser0213cb
 
EU POPs Limits & Digital Product Passports Compliance Strategy 2025.pptx
Certivo Inc
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
The Future of Smart Factories Why Embedded Analytics Leads the Way
Varsha Nayak
 
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 

Angular js for Beginnners

  • 2. What is AngularJS • JavaScript MVC framework for the Web • pure JavaScript and HTML • Unit Testable • For Web and Mobile • Less code • Can integrate 3rd party libraries such as jQueryUI/BootStrap
  • 3. MVC • The model is the driving force of the application. This is generally the data behind the application, usually fetched from the server. Any UI with data that the user sees is derived from the model, or a subset of the model. • The view is the UI that the user sees and interacts with. It is dynamic, and generated based on the current model of the application • The controller is the business logic and presentation layer, which performs actions such as fetching data, and makes decisions such as how to present the model, which parts of it to display, etc.
  • 5. Task – 1 • Write a Angular Application which prints the value of below expressions: • 5 *5 + 2*2 • 10/5*2-100
  • 6. AngularJS Directives • Markers on DOM elements (such as elements, attributes, css, and more). • Used to create custom HTML tags that serve as new, custom widgets. • AngularJS has built-in directives (ngBind, ngModel...)
  • 7. directive ng-app • first and most important directive • Tells the section of HTML that AngularJS controls • Need to put in any tag, preferable at <html> or <body> • Anything outside of the tag would not be processed
  • 9. directive ng-model • used with input fields, user to enter any data and get access to the value in JavaScript. • In ng-model="n1", AngularJS stores the value that the user types into in a variable called "n1"
  • 10. directive ng-bind • Binds with the Angular JS variable • ng-bind in <span> <span ng-bind="n1" is similar to {{n1}}
  • 11. Modules • Modules in AngularJS are similar to packages in java • Container for the different parts of your app – controllers, services, filters, directives, etc. • Can define its own controllers, services, factories, and directives which are accessed throughout the module. • Can depend on other modules as dependencies and made available to all the code defined in this module.
  • 12. • angular.module(‘myApp', []); Creating a module with no dependencies • angular.module(‘myApp', ['myapp.ui', 'yourapp.diagram']); Creating a module with 2 other dependent modules • angular.module(‘myApp'); • looks an existing module to make it available to use, add, or modify in the current file. Module name we define Array of dependent modules Modules
  • 13. Controller • Fetch data from the server for UI • Are regular JavaScript Objects. • ng-controller directive defines the application controller.
  • 14. Parent module Child modules Defined 2 Controllers Using parent module only
  • 15. Task – 2 • Write an Angular Application which prints current date and time on the screen
  • 16. controllerAs • Can be used in AngularJS 1.2 and later • Allows to define the variables on the controller instance using the this keyword instead of $scope • Directly can be referred through the controller from the HTML
  • 17. controllerAs $scope.name = 'some value' changed to this.name = 'some value'; ng-controller="EmpController" changed to ng-controller="EmpController as emp" {{ name }} changed to {{ emp.name }}
  • 19. directive ng-repeat • Similar to for each loop • Allows to iterate over an array • Allows to iterate over keys and values of an object • Syntax: ng-repeat="eachVar in arrayVar"
  • 22. Task – 3 • Write an Angular Application as • Create a list which stores value of 5 students (id, name, marks) in a school • In HTML, print the name and marks of all the students.
  • 25. Forms • ng-submit • ng-disabled = "myForm.$invalid" • required
  • 26. form
  • 27. JS
  • 28. Task – 4 • Write an Angular Application • Add few controls with different validation • Add a submit button in the form. • Submit button should be enabled only when all the validations are passed.
  • 29. Error Handling • Form validation • required • ng-required • ng-minlength • ng-maxlength • ng-pattern • type="email" • type="number" • type="date" • type="url"
  • 30. Dependency Injection • Any service known to AngularJS can be injected into any other service, directive, or controller by stating it as a dependency. • AngularJS will automatically create the entire chain before injecting.
  • 32. Services • Service that is a reusable API or substitutable objects, which can be shared across our applications. • A service in AngularJS can be implemented as a • factory • service • provider
  • 34. Common built-In Services • $window • $log • $http • $location • $timeout • $interval Points to remember: • AngularJS prefixes all the services that are provided by the AngularJS library with the $ sign. • when you create your own services, do not prefix them with a $ sign. It will just end up confusing you and your team at some point in time
  • 36. Creating Our Own Service
  • 37. Creating your own service
  • 38. Data with $http • Similar to request to the server from AJAX applications (using XMLHttpRequests) • Makes request • reads response • checks the error codes • processes the server response • Traditional • var xmlhttp = new XMLHttpRequest(); • xmlhttp.open("GET", "http://myserver/api", true);
  • 39. Few test cases: Input: 1, output: 1 Input:10, output: A Input:15, output: F Task – 5 • Write a Angular Application • Add a service, this will take a decimal number as input and print the hexadecimal value of that number.
  • 40. $http with REST APIs • GET • HEAD • POST • DELETE • PUT • JSONP
  • 42. Task – 6 • Write a Angular Application • Which consumes restful web-service with GET, POST, DELETE (you can write a web-service or see some examples with node.js to create demo restful web- service)
  • 44. Filters • Process data and format values to present • Applied on expressions in HTML • Applied directly on data in our controllers and services • Examples: • Format timestamp to readable date string • Add currency symbol on a number
  • 46. Task – 7 • Write a Angular Application • Use in-built filters and produce the below output (you can write a web-service or see some examples with node.js to create demo restful web- service)
  • 47. Task – 8 • Write a Angular Application and use below built-in filters • orderBy • filter • json • limitTo
  • 49. Task – 8 • Write a custom filter which accepts a string value and prints every alternate character in lower case preceding to a upper case character. Test cases: Input: AngularJS output:AnGuLaRjS
  • 51. Routing with URL - myurl.html#/home • You need Routing if • we call hashbang URLs, not the standard URL • You are developing a single page application • You have multiple views for a single page (e.g. Home Page, About Us, Contact Us etc.) • For each request in a single page, you need to load one of the view as presentation logic but you don’t want to refresh the page. • You don’t need to load the whole page but only the contents of the view • You need speed response by loading contents faster
  • 52. Routing: how to code • Import angular.js and angular-route.js • Use dependancy model to ngRoute var myvar = angular.module('org',['ngRoute']); • Config the route provider $routeProvider.when(url, { template: string, templateUrl: string, controller: string, function or array, controllerAs: string, resolve: object<key, function> });
  • 54. Request in routing : ‘#’ factor • Request in a common URLs: # in URLs
  • 55. Task – 9 Make 3 Angular applications (3 views) • Home.html • About.html • Contact.html In index.html, you need to define 3 links for home, about and contact. On clicking the links it needs to route to respective views without reloading the page. (Note: You may need to deploy as an application in a server to make it work.)
  • 56. Things to do: • I didn’t cover the unit testing parts in AngularJS along with mocking up in this presentation for each of the components. I request you to go through the steps for unit testing in internet. If I get time I would add unit testing in a separate presentation. Thank you.
  • 58. Source Code at: • https://github.com/santoshkar/Angular.git