SlideShare a Scribd company logo
AngularJS
Maurice de Beijer
 Maurice de Beijer
 The Problem Solver

 Microsoft Integration MVP

Who am I?

 Freelance developer
 DevelopMentor instructor
 Twitter:

@mauricedb

 Blog:

http://msmvps.com/blogs/TheProblemSolver/

 Web:

http://www.TheProblemSolver.nl

 E-mail:

maurice.de.beijer@gmail.com
 What is AngularJS?

Objectives

 Getting started
 Directives
 Routing
 Services
 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

What is
AngularJS?

 Version 1.0 was released in June 2012
 Currently at 1.2.0-rc-3

 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
 Model View Controller architecture

 A well known and proven architecture

 Declarative two way data binding

 Automatically synchronizes values between Model and View

 Dynamic templates

Key features

 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
Extending
HTML
Extending
HTML
 Visual Studio 2012

 Several ways to get IntelliSense

 Visual Studio 2013

Tooling

 Understands directives and provides IntelliSense

 WebStorm

 Including support for Live Edit

 Batarang

 Chrome plugin

 Karma Test Runner
 Automatic bootstrapping

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
Model

The MVC of
AngularJS
Controller

View
Model

Model

 The business data
 Exposed to the view through the $scope

Controller

View
Model

 The user interface layer

View

Controller

 Data binds to the model
 Calls functions on the controller

 Use declarative directives for reusable code

View
Model

Controller

Controller

 Glues the view and the model together
 Provides additional functionality
 Uses additional services for reusable logic

View
Model

Services

View

 Services are reusable pieces of business logic

Services

 Separation results in reuse and testability

Controller

 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
Model

Controller

$scope

 The glue between the Model and View
 Don’t use as the Model!

View
 Many general purpose services provided by AngularJS
 $http

 Used for XMLHttpRequest handling

 $location

Standard
Services

 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
 AngularJS uses dependency injection to decouple modules

Dependency
injection

 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
 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

Standard
directives











ngApp
ngBind
ngModel
ngRepeat
ngClick
ngEnable/ngDisable
ngHide/ngShow
ngView
…
 Turn HTML into your Domain Specific Language

Custom
directives

 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
 Used to create SPA style application

 The page can change without using the server

 The ngView is often used to render a template

Routing

 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
 The basic service for doing all HTTP requests
 The building block for all AJAX requests

 Can be used as a function
 $http(config)

$http service

 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
 Creates a service for working with RESTful services
 Much easier than using the $http object

$resource

 Standard functions are already preconfigured
 Only the common HTTP PUT is missing

 Requires a dependency on ngResource
 Located in angular-resource.js
 The $httpBackend is the service that is responsible

Unit testing
AJAX code

 Use the XMLHttpRequest object

 There is a second version in the ngMock module

 Used for unit testing code that does HTTP requests

 Can be configured to fake HTTP requests
 Or verify that HTTP calls where made
 AngularJS is a complete framework for client side applications
 Based on the standard MVC design pattern

Summary

 Two way data binding makes it easy to build data entry forms
 Dependency injection makes it easy to separate modules
 Build with testing in mind
The code

 Check http://msmvps.com/blogs/theproblemsolver/

More Related Content

What's hot (20)

PPTX
Introduction to Angularjs
Manish Shekhawat
 
PPTX
Angular Data Binding
Jennifer Estrada
 
PPTX
Angular 14.pptx
MohaNedGhawar
 
PPTX
Introduction to spring boot
Santosh Kumar Kar
 
PPTX
Spring Framework
tola99
 
PPTX
Angular 5 presentation for beginners
Imran Qasim
 
PDF
VueJS Introduction
David Ličen
 
PDF
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
PPTX
Introduction to AngularJS
David Parsons
 
PDF
Vue, vue router, vuex
Samundra khatri
 
PDF
Introduction to HTML5
Gil Fink
 
PDF
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
PPTX
MVVM ( Model View ViewModel )
Ahmed Emad
 
PPT
Angular 8
Sunil OS
 
PDF
Introduction to ASP.NET Core
Avanade Nederland
 
PPTX
Web api
Sudhakar Sharma
 
PDF
Vue.js
Jadson Santos
 
PPTX
Spring mvc
Harshit Choudhary
 
Introduction to Angularjs
Manish Shekhawat
 
Angular Data Binding
Jennifer Estrada
 
Angular 14.pptx
MohaNedGhawar
 
Introduction to spring boot
Santosh Kumar Kar
 
Spring Framework
tola99
 
Angular 5 presentation for beginners
Imran Qasim
 
VueJS Introduction
David Ličen
 
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Introduction to AngularJS
David Parsons
 
Vue, vue router, vuex
Samundra khatri
 
Introduction to HTML5
Gil Fink
 
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
MVVM ( Model View ViewModel )
Ahmed Emad
 
Angular 8
Sunil OS
 
Introduction to ASP.NET Core
Avanade Nederland
 
Spring mvc
Harshit Choudhary
 

Viewers also liked (14)

PDF
AngularJS Basics with Example
Sergey Bolshchikov
 
PDF
AngularJS Framework
CloudVis Technology
 
PPTX
AngularJS Best Practices
Narek Mamikonyan
 
PPTX
Angular js
Mindtree
 
PDF
Advantages of angular js for development
VedRaj2015
 
PPTX
Kalp Corporate Angular Js Tutorials
Kalp Corporate
 
PPTX
The AngularJS way
Boyan Mihaylov
 
PDF
Introduction to AngularJS
Jussi Pohjolainen
 
PPTX
Angular js tutorial slides
samhelman
 
PPTX
Angular JS
John Temoty Roca
 
PPTX
Why angular js Framework
Sakthi Bro
 
PDF
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
 
PPTX
Understanding angular js
Aayush Shrestha
 
PPTX
AngularJS Architecture
Eyal Vardi
 
AngularJS Basics with Example
Sergey Bolshchikov
 
AngularJS Framework
CloudVis Technology
 
AngularJS Best Practices
Narek Mamikonyan
 
Angular js
Mindtree
 
Advantages of angular js for development
VedRaj2015
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate
 
The AngularJS way
Boyan Mihaylov
 
Introduction to AngularJS
Jussi Pohjolainen
 
Angular js tutorial slides
samhelman
 
Angular JS
John Temoty Roca
 
Why angular js Framework
Sakthi Bro
 
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
 
Understanding angular js
Aayush Shrestha
 
AngularJS Architecture
Eyal Vardi
 
Ad

Similar to AngularJS (20)

PPTX
AngularJS = Browser applications on steroids
Maurice De Beijer [MVP]
 
PDF
MVC Interview Questions PDF By ScholarHat
Scholarhat
 
PPTX
Intoduction to Angularjs
Gaurav Agrawal
 
PDF
Introduction to Angularjs : kishan kumar
Appfinz Technologies
 
PDF
AngularJS: Overview & Key Features
Mohamad Al Asmar
 
PPTX
ASp.net Mvc 5
ahmedxp kh
 
PPTX
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
murtazahaveliwala
 
PPTX
Angular patterns
Premkumar M
 
PPTX
Mvc
Furqan Ashraf
 
PDF
End to-End SPA Development Using ASP.NET and AngularJS
Gil Fink
 
PPTX
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
Learnimtactics
 
PPT
Getting started with angular js
Maurice De Beijer [MVP]
 
PPT
Getting started with angular js
Maurice De Beijer [MVP]
 
PPTX
AngularJs Workshop SDP December 28th 2014
Ran Wahle
 
PDF
AngularJS By Vipin
Vipin Mundayad
 
PPTX
Introduction to AngularJS
Shyjal Raazi
 
PPTX
Angular js
vu van quyet
 
PPTX
Valentine with Angular js - Introduction
Senthil Kumar
 
PPTX
Training On Angular Js
Mahima Radhakrishnan
 
PPTX
MVC 4
Vasilios Kuznos
 
AngularJS = Browser applications on steroids
Maurice De Beijer [MVP]
 
MVC Interview Questions PDF By ScholarHat
Scholarhat
 
Intoduction to Angularjs
Gaurav Agrawal
 
Introduction to Angularjs : kishan kumar
Appfinz Technologies
 
AngularJS: Overview & Key Features
Mohamad Al Asmar
 
ASp.net Mvc 5
ahmedxp kh
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
murtazahaveliwala
 
Angular patterns
Premkumar M
 
End to-End SPA Development Using ASP.NET and AngularJS
Gil Fink
 
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
Learnimtactics
 
Getting started with angular js
Maurice De Beijer [MVP]
 
Getting started with angular js
Maurice De Beijer [MVP]
 
AngularJs Workshop SDP December 28th 2014
Ran Wahle
 
AngularJS By Vipin
Vipin Mundayad
 
Introduction to AngularJS
Shyjal Raazi
 
Angular js
vu van quyet
 
Valentine with Angular js - Introduction
Senthil Kumar
 
Training On Angular Js
Mahima Radhakrishnan
 
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]
 

Recently uploaded (20)

PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 

AngularJS

  • 2.  Maurice de Beijer  The Problem Solver  Microsoft Integration MVP Who am I?  Freelance developer  DevelopMentor instructor  Twitter: @mauricedb  Blog: http://msmvps.com/blogs/TheProblemSolver/  Web: http://www.TheProblemSolver.nl  E-mail: [email protected]
  • 3.  What is AngularJS? Objectives  Getting started  Directives  Routing  Services
  • 4.  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 What is AngularJS?  Version 1.0 was released in June 2012  Currently at 1.2.0-rc-3  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
  • 5.  Model View Controller architecture  A well known and proven architecture  Declarative two way data binding  Automatically synchronizes values between Model and View  Dynamic templates Key features  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
  • 8.  Visual Studio 2012  Several ways to get IntelliSense  Visual Studio 2013 Tooling  Understands directives and provides IntelliSense  WebStorm  Including support for Live Edit  Batarang  Chrome plugin  Karma Test Runner
  • 9.  Automatic bootstrapping 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
  • 11. Model Model  The business data  Exposed to the view through the $scope Controller View
  • 12. Model  The user interface layer View Controller  Data binds to the model  Calls functions on the controller  Use declarative directives for reusable code View
  • 13. Model Controller Controller  Glues the view and the model together  Provides additional functionality  Uses additional services for reusable logic View
  • 14. Model Services View  Services are reusable pieces of business logic Services  Separation results in reuse and testability Controller  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
  • 15. Model Controller $scope  The glue between the Model and View  Don’t use as the Model! View
  • 16.  Many general purpose services provided by AngularJS  $http  Used for XMLHttpRequest handling  $location Standard Services  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
  • 17.  AngularJS uses dependency injection to decouple modules Dependency injection  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
  • 18.  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 Standard directives          ngApp ngBind ngModel ngRepeat ngClick ngEnable/ngDisable ngHide/ngShow ngView …
  • 19.  Turn HTML into your Domain Specific Language Custom directives  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
  • 20.  Used to create SPA style application  The page can change without using the server  The ngView is often used to render a template Routing  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
  • 21.  The basic service for doing all HTTP requests  The building block for all AJAX requests  Can be used as a function  $http(config) $http service  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
  • 22.  Creates a service for working with RESTful services  Much easier than using the $http object $resource  Standard functions are already preconfigured  Only the common HTTP PUT is missing  Requires a dependency on ngResource  Located in angular-resource.js
  • 23.  The $httpBackend is the service that is responsible Unit testing AJAX code  Use the XMLHttpRequest object  There is a second version in the ngMock module  Used for unit testing code that does HTTP requests  Can be configured to fake HTTP requests  Or verify that HTTP calls where made
  • 24.  AngularJS is a complete framework for client side applications  Based on the standard MVC design pattern Summary  Two way data binding makes it easy to build data entry forms  Dependency injection makes it easy to separate modules  Build with testing in mind
  • 25. The code  Check http://msmvps.com/blogs/theproblemsolver/