SlideShare a Scribd company logo
Getting started with AngularJS
Maurice de Beijer
Who am I?
Maurice de Beijer
The Problem Solver
Microsoft Integration MVP
Freelance developer
DevelopMentor instructor
Twitter:
@mauricedb
http://msmvps.com/blogs/theproblemsolver/
• Blog:
http://www.TheProblemSolver.nl
• Web:
mauricedb@develop.com
• E-mail:
•
•
•
•
•
•

2
What are we going to cover?
•
•
•
•
•

What is AngularJS?
Getting started
Directives
Routing
Services

• Demos at:
– http://bit.ly/dmangularjs
• Source code at:
– https://github.com/mauricedb/DM-Starting-AngularJS

3
What is AngularJS?
• AngularJS is an MVC framework for browser based apps
– Open source and originally developed at Google
• The clean architecture has attracted a large following quickly
– Version 1.0 was released in June 2012
– Currently at 1.2.9
• The goal is building CRUD style business applications
– Not as suitable for games etc
• Use declarative programming for UI and imperative
programming for the logic
– The application is wired together in a declarative way
• Supports modern desktop and mobile browsers
– Internet Explorer version 8 and above

4
Key features
• Model View Controller architecture
– A well known and proven architecture
• Declarative two way data binding
– Automatically synchronizes values between Model and View
• Dynamic templates
– Makes it very easy to update the user interface
• Dependency injections
– Code dependencies are automatically injected where needed
• Extends HTML with directives
– Lots of powerful standard directives or create your own
• Build with testing in mind
– Makes it much easier to unit test different parts

5
Bootstrapping
• Automatic bootstrapping
– Add a reference to AngularJS
– Add the ngApp attribute
• Manual bootstrapping is also possible
– Gives you more control
– For example when using AMD/RequireJS

6
The MVC of AngularJS

7
Model
• The business data
• Exposed to the view through the $scope

8
View
•
•
•
•

The user interface layer
Data binds to the model
Calls functions on the controller
Use declarative directives for reusable code

9
Controller
• Glues the view and the model together
• Provides additional functionality
• Uses additional services for reusable logic

10
Services
• Services are reusable pieces of business logic
– Separation results in reuse and testability
• Created as singleton objects
– Inject by AngularJS using dependency injection
• Services are created as part of a module
– One module can take a dependency on another module
• Modules are groupings of related functionality
– Also used to bootstrap the application

11
Standard Services
• Many general purpose services provided by AngularJS
– $http
• Used for XMLHttpRequest handling
– $location
• Provide information about the current URL
– $q
• A promise/deferred module for asynchronous requests
– $routeProvider
• Configure routes in an SPA
– $log
• Logging service
– Many more

12
Dependency injection
• AngularJS uses dependency injection to decouple modules
– Dependencies are automatically injected by the framework
• Based on the parameter name
• JavaScript is often minified in production
– Need to provide AngularJS with some extra hints

13
Standard directives
• Directives allow you to enhance HTML with new capabilities
– Start using HTML as a domain specific language
• AngularJS comes with a long list of standard directives
– ngApp
– ngBind
– ngModel
– ngRepeat
– ngClick
– ngEnable/ngDisable
– ngHide/ngShow
– ngView
– …

14
Custom directives
• Turn HTML into your Domain Specific Language
– Use templates to embed complete blocks
• Can use either attributes, elements, CSS classes or comments
• Directives let you interact with the DOM
– The place for jQuery code

15
Routing
• Used to create SPA style application
– The page can change without using the server
• The ngView is often used to render a template
– HTML templates loaded when needed
– Can also be pre loaded as script with type="text/ng-template"
• The $routeProvider service is used to configure the route
• The $location service can be used to navigate
– Using an anchor tag is also possible
• The $routeParams service can be used to retrieve parameters
– Properties named in the route URL template

16
$http service
• The basic service for doing all HTTP requests
– The building block for all AJAX requests
• Can be used as a function
– $http(config)
• Provides a number of shortcut methods
– $http.post(url, config)
– $http.get(url, config)
– $http.put(url, config)
– $http.delete(url, config)
• Uses the promises API as the result
– Provided by the $q service

17
$resource
• Creates a service for working with RESTful services
– Much easier than using the $http object
• Standard functions are already preconfigured
– Only the common HTTP PUT is missing
• Requires a dependency on ngResource
– Located in angular-resource.js

18
Questions

?
The presentation and source code will be available
http://msmvps.com/blogs/theproblemsolver/

19

More Related Content

What's hot (20)

PPT
Angular js
yogi_solanki
Ā 
PDF
Introduction To Single Page Application
KMS Technology
Ā 
PPTX
ASP.NET MVC 4 Overview
Gunnar Peipman
Ā 
PPTX
Learning AngularJS - Complete coverage of AngularJS features and concepts
Suresh Patidar
Ā 
PDF
Mastering asp.net mvc - Dot Net Tricks
Gaurav Singh
Ā 
PPTX
Improving Perceived Page Performance with ASP.NET Web API and AJAX
Chris Bohatka
Ā 
PDF
Server rendering-talk
Daiwei Lu
Ā 
PPTX
Webpack
Anjali Chawla
Ā 
PDF
SPA, Scalable Application & AngularJS
Mitch Chen
Ā 
PPTX
Single Page Applications on JavaScript and ASP.NET MVC4
Yuriy Shapovalov
Ā 
PPT
Angular js
Hritesh Saha
Ā 
KEY
SGCE 2012 Lightning Talk-Single Page Interface
Domingo Suarez Torres
Ā 
PDF
Symfony2 for Midgard Developers
Henri Bergius
Ā 
PPTX
Angular js for enteprise application
vu van quyet
Ā 
PPTX
Angularjs basic part01
Mohd Abdul Baquee
Ā 
PPTX
The RAW stack
Maurice De Beijer [MVP]
Ā 
PPT
Jquery
Swapnil & Patil
Ā 
PPTX
Pros and Cons of developing a Thick Clientside App
Ravi Teja
Ā 
PDF
Future development stack ~ MeteorJS
Victor Stan
Ā 
PPTX
ASP.NET 5 Overview
Shahed Chowdhuri
Ā 
Angular js
yogi_solanki
Ā 
Introduction To Single Page Application
KMS Technology
Ā 
ASP.NET MVC 4 Overview
Gunnar Peipman
Ā 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Suresh Patidar
Ā 
Mastering asp.net mvc - Dot Net Tricks
Gaurav Singh
Ā 
Improving Perceived Page Performance with ASP.NET Web API and AJAX
Chris Bohatka
Ā 
Server rendering-talk
Daiwei Lu
Ā 
Webpack
Anjali Chawla
Ā 
SPA, Scalable Application & AngularJS
Mitch Chen
Ā 
Single Page Applications on JavaScript and ASP.NET MVC4
Yuriy Shapovalov
Ā 
Angular js
Hritesh Saha
Ā 
SGCE 2012 Lightning Talk-Single Page Interface
Domingo Suarez Torres
Ā 
Symfony2 for Midgard Developers
Henri Bergius
Ā 
Angular js for enteprise application
vu van quyet
Ā 
Angularjs basic part01
Mohd Abdul Baquee
Ā 
The RAW stack
Maurice De Beijer [MVP]
Ā 
Pros and Cons of developing a Thick Clientside App
Ravi Teja
Ā 
Future development stack ~ MeteorJS
Victor Stan
Ā 
ASP.NET 5 Overview
Shahed Chowdhuri
Ā 

Similar to Getting started with angular js (20)

PPT
Getting started with angular js
Maurice De Beijer [MVP]
Ā 
PDF
End to-End SPA Development Using ASP.NET and AngularJS
Gil Fink
Ā 
PPTX
AngularJS
Mahmoud Tolba
Ā 
PPTX
AngularJS
Maurice De Beijer [MVP]
Ā 
PPTX
AngularJS = Browser applications on steroids
Maurice De Beijer [MVP]
Ā 
PPT
Angularjs for kolkata drupal meetup
Goutam Dey
Ā 
PPTX
Angular patterns
Premkumar M
Ā 
PPTX
Tech io spa_angularjs_20130814_v0.9.5
Ganesh Kondal
Ā 
PDF
CraftCamp for Students - Introduction to AngularJS
craftworkz
Ā 
PPTX
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
Ā 
PDF
The future of web development write once, run everywhere with angular js an...
Mark Leusink
Ā 
PPTX
Quick Start to AngularJS
Return on Intelligence
Ā 
PPTX
Building share point apps with angularjs
Ahmed Elharouny
Ā 
PPTX
Angular js 1.0-fundamentals
Venkatesh Narayanan
Ā 
PPTX
Introduction to AngularJs
murtazahaveliwala
Ā 
PPTX
Angular js 1.3 basic tutorial
Al-Mutaz Bellah Salahat
Ā 
PPTX
Module2
HoĆ ng LĆŖ
Ā 
PDF
AngularJS Basics and Best Practices - CC FE &UX
JWORKS powered by Ordina
Ā 
PPTX
Angular js workshop
Rolands Krumbergs
Ā 
PDF
Creating Modular Test-Driven SPAs with Spring and AngularJS
Gunnar Hillert
Ā 
Getting started with angular js
Maurice De Beijer [MVP]
Ā 
End to-End SPA Development Using ASP.NET and AngularJS
Gil Fink
Ā 
AngularJS
Mahmoud Tolba
Ā 
AngularJS = Browser applications on steroids
Maurice De Beijer [MVP]
Ā 
Angularjs for kolkata drupal meetup
Goutam Dey
Ā 
Angular patterns
Premkumar M
Ā 
Tech io spa_angularjs_20130814_v0.9.5
Ganesh Kondal
Ā 
CraftCamp for Students - Introduction to AngularJS
craftworkz
Ā 
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
Ā 
The future of web development write once, run everywhere with angular js an...
Mark Leusink
Ā 
Quick Start to AngularJS
Return on Intelligence
Ā 
Building share point apps with angularjs
Ahmed Elharouny
Ā 
Angular js 1.0-fundamentals
Venkatesh Narayanan
Ā 
Introduction to AngularJs
murtazahaveliwala
Ā 
Angular js 1.3 basic tutorial
Al-Mutaz Bellah Salahat
Ā 
Module2
HoĆ ng LĆŖ
Ā 
AngularJS Basics and Best Practices - CC FE &UX
JWORKS powered by Ordina
Ā 
Angular js workshop
Rolands Krumbergs
Ā 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Gunnar Hillert
Ā 
Ad

More from Maurice De Beijer [MVP] (20)

PPTX
Full-stack App in half a Day: Next.js 15 Development Bootcamp
Maurice De Beijer [MVP]
Ā 
PPTX
Production-ready Next.js App with Cursor AI
Maurice De Beijer [MVP]
Ā 
PPTX
Building Robust Web Applications with Test-Driven Development and Playwright:...
Maurice De Beijer [MVP]
Ā 
PDF
Mastering React Server Components and Server Actions in React 19
Maurice De Beijer [MVP]
Ā 
PPTX
Practice TypeScript Techniques Building React Server Components App
Maurice De Beijer [MVP]
Ā 
PPTX
A foolproof Way to Estimate a Software Project
Maurice De Beijer [MVP]
Ā 
PPTX
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
Ā 
PPTX
Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
Ā 
PPTX
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
Ā 
PPTX
Concurrent Rendering Adventures in React 18
Maurice De Beijer [MVP]
Ā 
PPTX
Building reliable applications with React, C#, and Azure
Maurice De Beijer [MVP]
Ā 
PPTX
Building large and scalable mission critical applications with React
Maurice De Beijer [MVP]
Ā 
PPTX
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
Ā 
PPTX
Why I am hooked on the future of React
Maurice De Beijer [MVP]
Ā 
PPTX
Building reliable web applications using Cypress
Maurice De Beijer [MVP]
Ā 
PPTX
Getting started with React Suspense and concurrent rendering
Maurice De Beijer [MVP]
Ā 
PPTX
React suspense, not just for Alfred Hitchcock
Maurice De Beijer [MVP]
Ā 
PPTX
From zero to hero with the Reactive extensions for JavaScript
Maurice De Beijer [MVP]
Ā 
PPTX
Why I am hooked on the future of React
Maurice De Beijer [MVP]
Ā 
PPTX
The new React
Maurice De Beijer [MVP]
Ā 
Full-stack App in half a Day: Next.js 15 Development Bootcamp
Maurice De Beijer [MVP]
Ā 
Production-ready Next.js App with Cursor AI
Maurice De Beijer [MVP]
Ā 
Building Robust Web Applications with Test-Driven Development and Playwright:...
Maurice De Beijer [MVP]
Ā 
Mastering React Server Components and Server Actions in React 19
Maurice De Beijer [MVP]
Ā 
Practice TypeScript Techniques Building React Server Components App
Maurice De Beijer [MVP]
Ā 
A foolproof Way to Estimate a Software Project
Maurice De Beijer [MVP]
Ā 
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
Ā 
Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
Ā 
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
Ā 
Concurrent Rendering Adventures in React 18
Maurice De Beijer [MVP]
Ā 
Building reliable applications with React, C#, and Azure
Maurice De Beijer [MVP]
Ā 
Building large and scalable mission critical applications with React
Maurice De Beijer [MVP]
Ā 
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
Ā 
Why I am hooked on the future of React
Maurice De Beijer [MVP]
Ā 
Building reliable web applications using Cypress
Maurice De Beijer [MVP]
Ā 
Getting started with React Suspense and concurrent rendering
Maurice De Beijer [MVP]
Ā 
React suspense, not just for Alfred Hitchcock
Maurice De Beijer [MVP]
Ā 
From zero to hero with the Reactive extensions for JavaScript
Maurice De Beijer [MVP]
Ā 
Why I am hooked on the future of React
Maurice De Beijer [MVP]
Ā 
The new React
Maurice De Beijer [MVP]
Ā 
Ad

Recently uploaded (20)

PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
Ā 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
Ā 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
Ā 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
Ā 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
Ā 
PPTX
Digital Circuits, important subject in CS
contactparinay1
Ā 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
Ā 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
Ā 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
Ā 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
Ā 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
Ā 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
Ā 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
Ā 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
Ā 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
Ā 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
Ā 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
Ā 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
Ā 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
Ā 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
Ā 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
Ā 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
Ā 
The Project Compass - GDG on Campus MSIT
dscmsitkol
Ā 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
Ā 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
Ā 
Digital Circuits, important subject in CS
contactparinay1
Ā 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
Ā 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
Ā 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
Ā 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
Ā 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
Ā 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
Ā 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
Ā 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
Ā 
How do you fast track Agentic automation use cases discovery?
DianaGray10
Ā 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
Ā 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
Ā 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
Ā 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
Ā 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
Ā 

Getting started with angular js

  • 1. Getting started with AngularJS Maurice de Beijer
  • 2. Who am I? Maurice de Beijer The Problem Solver Microsoft Integration MVP Freelance developer DevelopMentor instructor Twitter: @mauricedb http://msmvps.com/blogs/theproblemsolver/ • Blog: http://www.TheProblemSolver.nl • Web: [email protected] • E-mail: • • • • • • 2
  • 3. What are we going to cover? • • • • • What is AngularJS? Getting started Directives Routing Services • Demos at: – http://bit.ly/dmangularjs • Source code at: – https://github.com/mauricedb/DM-Starting-AngularJS 3
  • 4. What is AngularJS? • AngularJS is an MVC framework for browser based apps – Open source and originally developed at Google • The clean architecture has attracted a large following quickly – Version 1.0 was released in June 2012 – Currently at 1.2.9 • The goal is building CRUD style business applications – Not as suitable for games etc • Use declarative programming for UI and imperative programming for the logic – The application is wired together in a declarative way • Supports modern desktop and mobile browsers – Internet Explorer version 8 and above 4
  • 5. Key features • Model View Controller architecture – A well known and proven architecture • Declarative two way data binding – Automatically synchronizes values between Model and View • Dynamic templates – Makes it very easy to update the user interface • Dependency injections – Code dependencies are automatically injected where needed • Extends HTML with directives – Lots of powerful standard directives or create your own • Build with testing in mind – Makes it much easier to unit test different parts 5
  • 6. Bootstrapping • Automatic bootstrapping – Add a reference to AngularJS – Add the ngApp attribute • Manual bootstrapping is also possible – Gives you more control – For example when using AMD/RequireJS 6
  • 7. The MVC of AngularJS 7
  • 8. Model • The business data • Exposed to the view through the $scope 8
  • 9. View • • • • The user interface layer Data binds to the model Calls functions on the controller Use declarative directives for reusable code 9
  • 10. Controller • Glues the view and the model together • Provides additional functionality • Uses additional services for reusable logic 10
  • 11. Services • Services are reusable pieces of business logic – Separation results in reuse and testability • Created as singleton objects – Inject by AngularJS using dependency injection • Services are created as part of a module – One module can take a dependency on another module • Modules are groupings of related functionality – Also used to bootstrap the application 11
  • 12. Standard Services • Many general purpose services provided by AngularJS – $http • Used for XMLHttpRequest handling – $location • Provide information about the current URL – $q • A promise/deferred module for asynchronous requests – $routeProvider • Configure routes in an SPA – $log • Logging service – Many more 12
  • 13. Dependency injection • AngularJS uses dependency injection to decouple modules – Dependencies are automatically injected by the framework • Based on the parameter name • JavaScript is often minified in production – Need to provide AngularJS with some extra hints 13
  • 14. Standard directives • Directives allow you to enhance HTML with new capabilities – Start using HTML as a domain specific language • AngularJS comes with a long list of standard directives – ngApp – ngBind – ngModel – ngRepeat – ngClick – ngEnable/ngDisable – ngHide/ngShow – ngView – … 14
  • 15. Custom directives • Turn HTML into your Domain Specific Language – Use templates to embed complete blocks • Can use either attributes, elements, CSS classes or comments • Directives let you interact with the DOM – The place for jQuery code 15
  • 16. Routing • Used to create SPA style application – The page can change without using the server • The ngView is often used to render a template – HTML templates loaded when needed – Can also be pre loaded as script with type="text/ng-template" • The $routeProvider service is used to configure the route • The $location service can be used to navigate – Using an anchor tag is also possible • The $routeParams service can be used to retrieve parameters – Properties named in the route URL template 16
  • 17. $http service • The basic service for doing all HTTP requests – The building block for all AJAX requests • Can be used as a function – $http(config) • Provides a number of shortcut methods – $http.post(url, config) – $http.get(url, config) – $http.put(url, config) – $http.delete(url, config) • Uses the promises API as the result – Provided by the $q service 17
  • 18. $resource • Creates a service for working with RESTful services – Much easier than using the $http object • Standard functions are already preconfigured – Only the common HTTP PUT is missing • Requires a dependency on ngResource – Located in angular-resource.js 18
  • 19. Questions ? The presentation and source code will be available http://msmvps.com/blogs/theproblemsolver/ 19