SlideShare a Scribd company logo
A gently introduction to AngularJS
Gregor Woiwode 
@GregOnNet 
Software must fit user needs, not vice versa! 
#empathic-business 
FAVORITE 
1
Web Apps?! 
I can’t! 
Of course, 
I can! 
discovers 
stunned
Downloads 
Source Code 
https://github.com/GregOnNet/angular-starter-demos 
https://github.com/GregOnNet/angular-cups
https://single-page.app/#/list What do we expect from a 
Search... 
+ 
single-page app? 
Reacting fast to user input 
Providing comprehensive interactions 
Using only one page?
https://single-page.app/#/card/one Mission accomplished - NOT! 
Card - One... 
Templating multiple views 
Routing between views 
Interacting with server side APIs 
Organizing app architecture that scales 
Binding & Presenting data 
Save 
Who cares about... 
Caching data
My personal pains 
A 
B 
D 
C 
Framework confetti
My personal pains 
A 
better 
A 
D 
Dependencies & Versioning
My personal salvation 
A 
B C D 
Choosing one 
pluggable ecosystem
What is in the box? 
{{ }} 
Data Binding 
two way 
one way 
change tracking
What is in the box? 
Modules 
controllers 
factories, services, providers 
directives, filter
What is in the box? 
Dependency Injection
What is in the box? 
Routing
What is in the box? 
Testing
What is in the box? 
Community 
31.3k Stars 
~ 96k Videos 
~ 63k Questions 
11th of November 
2014 
angularjs.org 
Documentation and 
Tutorials
Let’s get into code 
<html ng-app="demo"> 
// our awesome app 
</html>
Intermediate Function 
Expression - iife 
(function() { 
'use strict'; 
// Isolation 
})();
Why iife? 
script.js 
var greet = 'Hi!'; 
conflict.js 
var greet = 'Bye!'; 
Last man standing
Why iife? 
script.js 
(function () { 
'use strict'; 
var greet = 'Hi!'; 
})(); 
conflict.js 
(function () { 
'use strict'; 
var greet = 'Bye!'; 
})(); 
SAVE
Defining a module 
angular 
.module('app', [ 
'module', 
'feature' 
]); 
// Name your module... 
// … Extend it with 
// other modules
Defining a controller 
angular 
.module('app') 
.controller('Persons', Persons); 
function Persons() { 
}
Our first directive 
angular 
.module('app') 
.directive('semanticHtml', semanticHtml); 
function semanticHtml () { 
return { 
restrict : 'E | A | C', 
template : '<html-template>' 
}; 
} 
// Nearly the same like our 
// controller, right? 
// Watch out! 
// Directives return a new 
// object literal
Even more about directives 
function semanticHtml () { 
return { 
restrict : 'E | A | C', 
template : '<html-template>' 
templateUrl: 
scope: 
controller: 
link: 
}; 
}
Starting with filters 
angular 
.module('app') 
.filter('manipulate', manipulate); 
function manipulate() { 
return function(input, /* parameters */ ) { 
} 
} 
// Watch out! 
// Filters return a function.
There are many filters already 
implemented 
https://github.com/a8m/angular-filter
Defining a factory, service, 
whatever... 
angular 
.module('app') 
.factory('dataAccess', dataAccess); 
function dataAccess() { 
return { 
}; 
} 
// LEGO bricks the angular 
// way 
// Declaring the api of our 
// service
$injecting a service into a 
controller 
// angular magic 
angular 
.module('app') 
.controller('Persons', Persons); 
Persons.$inject = ['dataAccess']; 
function Persons(dataAccess) { 
}
$injecting a service into a 
controller 
angular 
.module('app') 
.controller('Persons', Persons); 
// still works without $inject 
function Persons(dataAccess) { 
}
$injecting a service into a 
controller 
angular 
.module('app') 
.controller('Persons', p); 
function p(a) { 
} 
// But a minifier will break 
// your app 
a cannot be 
resolved as 
dataAccess
events 
child 
controller 
parent 
controller 
$broadcast 
$emit 
$scope . $ e m i t ('eventName'); 
.$broadcast
events using $rootScope 
controller 
subscriber 
controller 
publisher 
$rootScope 
.$emit('eventName'); 
$rootScope 
.$on('eventName' , 
callback);
Join the AngularJS-World 
Make your first steps testing your apps 
Code cleaner with John Papa’s Style Guide 
Cheat Sheets help you to keep the overview 
Read Dan Wahlin’s AngularJS Magazin 
Use snippets provided by AngularJS Hub 
Subscribe to channels of AngularJS and NgEurope 
Stay up to date with the NG-Newsletter 
“click it”
Questions?

More Related Content

PDF
AngularJS Project Setup step-by- step guide - RapidValue Solutions
ODP
AngularJs Crash Course
PDF
AngularJS - Services
PDF
AngularJS application architecture
PPTX
AngularJs presentation
PDF
AngularJS Best Practices
PDF
Introduction to Unit Tests and TDD
PPTX
Angular js
AngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJs Crash Course
AngularJS - Services
AngularJS application architecture
AngularJs presentation
AngularJS Best Practices
Introduction to Unit Tests and TDD
Angular js

What's hot (20)

PDF
Beyond AngularJS: Best practices and more
PDF
AngularJS Basics and Best Practices - CC FE &UX
PDF
Angular Dependency Injection
PDF
AngularJS introduction
PPTX
Introduction to Angularjs
PDF
AngularJS Framework
PDF
Angular js
PDF
Angular from Scratch
PPTX
Angular js
PDF
AngularJS in practice
PPTX
ODP
Angular js-crash-course
PDF
Overview of the AngularJS framework
PDF
AngularJS - Overcoming performance issues. Limits.
PPTX
The Basics Angular JS
PPTX
Front end development with Angular JS
PDF
AngularJS - What is it & Why is it awesome ? (with demos)
PPTX
Understanding angular js
PPTX
Angular js architecture (v1.4.8)
PPTX
AngularJS Best Practices
Beyond AngularJS: Best practices and more
AngularJS Basics and Best Practices - CC FE &UX
Angular Dependency Injection
AngularJS introduction
Introduction to Angularjs
AngularJS Framework
Angular js
Angular from Scratch
Angular js
AngularJS in practice
Angular js-crash-course
Overview of the AngularJS framework
AngularJS - Overcoming performance issues. Limits.
The Basics Angular JS
Front end development with Angular JS
AngularJS - What is it & Why is it awesome ? (with demos)
Understanding angular js
Angular js architecture (v1.4.8)
AngularJS Best Practices
Ad

Similar to A gently introduction to AngularJS (20)

PPTX
Angular Presentation
PDF
AngularJS Workshop
PPTX
Practical AngularJS
PPTX
Angular workshop - Full Development Guide
PDF
AngularJS Basic Training
PDF
Building scalable applications with angular js
PPTX
The AngularJS way
PPT
Angular In Depth
PDF
Everything You Need To Know About AngularJS
PDF
PPTX
Walk in the shoe of angular
PPTX
Dive into Angular, part 1: Introduction
PDF
AngularJS - TechTalk 3/2/2014
PPTX
Angular js 1.0-fundamentals
PPTX
Introduction to AngularJs
PPTX
Intro to AngularJs
PPTX
AngularJS.part1
PDF
AngularJS Curriculum-Zeolearn
PPTX
Angular js
Angular Presentation
AngularJS Workshop
Practical AngularJS
Angular workshop - Full Development Guide
AngularJS Basic Training
Building scalable applications with angular js
The AngularJS way
Angular In Depth
Everything You Need To Know About AngularJS
Walk in the shoe of angular
Dive into Angular, part 1: Introduction
AngularJS - TechTalk 3/2/2014
Angular js 1.0-fundamentals
Introduction to AngularJs
Intro to AngularJs
AngularJS.part1
AngularJS Curriculum-Zeolearn
Angular js
Ad

Recently uploaded (20)

PPTX
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
PDF
System and Network Administration Chapter 2
PDF
Best Practices for Rolling Out Competency Management Software.pdf
PDF
Build Multi-agent using Agent Development Kit
PDF
Become an Agentblazer Champion Challenge
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPT
JAVA ppt tutorial basics to learn java programming
PDF
Digital Strategies for Manufacturing Companies
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
PPTX
Presentation of Computer CLASS 2 .pptx
PDF
How to Confidently Manage Project Budgets
DOCX
The Five Best AI Cover Tools in 2025.docx
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Convert Thunderbird to Outlook into bulk
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
System and Network Administration Chapter 2
Best Practices for Rolling Out Competency Management Software.pdf
Build Multi-agent using Agent Development Kit
Become an Agentblazer Champion Challenge
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
JAVA ppt tutorial basics to learn java programming
Digital Strategies for Manufacturing Companies
How to Migrate SBCGlobal Email to Yahoo Easily
PTS Company Brochure 2025 (1).pdf.......
Which alternative to Crystal Reports is best for small or large businesses.pdf
Upgrade and Innovation Strategies for SAP ERP Customers
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Presentation of Computer CLASS 2 .pptx
How to Confidently Manage Project Budgets
The Five Best AI Cover Tools in 2025.docx
How Creative Agencies Leverage Project Management Software.pdf
Convert Thunderbird to Outlook into bulk
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...

A gently introduction to AngularJS

  • 2. Gregor Woiwode @GregOnNet Software must fit user needs, not vice versa! #empathic-business FAVORITE 1
  • 3. Web Apps?! I can’t! Of course, I can! discovers stunned
  • 4. Downloads Source Code https://github.com/GregOnNet/angular-starter-demos https://github.com/GregOnNet/angular-cups
  • 5. https://single-page.app/#/list What do we expect from a Search... + single-page app? Reacting fast to user input Providing comprehensive interactions Using only one page?
  • 6. https://single-page.app/#/card/one Mission accomplished - NOT! Card - One... Templating multiple views Routing between views Interacting with server side APIs Organizing app architecture that scales Binding & Presenting data Save Who cares about... Caching data
  • 7. My personal pains A B D C Framework confetti
  • 8. My personal pains A better A D Dependencies & Versioning
  • 9. My personal salvation A B C D Choosing one pluggable ecosystem
  • 10. What is in the box? {{ }} Data Binding two way one way change tracking
  • 11. What is in the box? Modules controllers factories, services, providers directives, filter
  • 12. What is in the box? Dependency Injection
  • 13. What is in the box? Routing
  • 14. What is in the box? Testing
  • 15. What is in the box? Community 31.3k Stars ~ 96k Videos ~ 63k Questions 11th of November 2014 angularjs.org Documentation and Tutorials
  • 16. Let’s get into code <html ng-app="demo"> // our awesome app </html>
  • 17. Intermediate Function Expression - iife (function() { 'use strict'; // Isolation })();
  • 18. Why iife? script.js var greet = 'Hi!'; conflict.js var greet = 'Bye!'; Last man standing
  • 19. Why iife? script.js (function () { 'use strict'; var greet = 'Hi!'; })(); conflict.js (function () { 'use strict'; var greet = 'Bye!'; })(); SAVE
  • 20. Defining a module angular .module('app', [ 'module', 'feature' ]); // Name your module... // … Extend it with // other modules
  • 21. Defining a controller angular .module('app') .controller('Persons', Persons); function Persons() { }
  • 22. Our first directive angular .module('app') .directive('semanticHtml', semanticHtml); function semanticHtml () { return { restrict : 'E | A | C', template : '<html-template>' }; } // Nearly the same like our // controller, right? // Watch out! // Directives return a new // object literal
  • 23. Even more about directives function semanticHtml () { return { restrict : 'E | A | C', template : '<html-template>' templateUrl: scope: controller: link: }; }
  • 24. Starting with filters angular .module('app') .filter('manipulate', manipulate); function manipulate() { return function(input, /* parameters */ ) { } } // Watch out! // Filters return a function.
  • 25. There are many filters already implemented https://github.com/a8m/angular-filter
  • 26. Defining a factory, service, whatever... angular .module('app') .factory('dataAccess', dataAccess); function dataAccess() { return { }; } // LEGO bricks the angular // way // Declaring the api of our // service
  • 27. $injecting a service into a controller // angular magic angular .module('app') .controller('Persons', Persons); Persons.$inject = ['dataAccess']; function Persons(dataAccess) { }
  • 28. $injecting a service into a controller angular .module('app') .controller('Persons', Persons); // still works without $inject function Persons(dataAccess) { }
  • 29. $injecting a service into a controller angular .module('app') .controller('Persons', p); function p(a) { } // But a minifier will break // your app a cannot be resolved as dataAccess
  • 30. events child controller parent controller $broadcast $emit $scope . $ e m i t ('eventName'); .$broadcast
  • 31. events using $rootScope controller subscriber controller publisher $rootScope .$emit('eventName'); $rootScope .$on('eventName' , callback);
  • 32. Join the AngularJS-World Make your first steps testing your apps Code cleaner with John Papa’s Style Guide Cheat Sheets help you to keep the overview Read Dan Wahlin’s AngularJS Magazin Use snippets provided by AngularJS Hub Subscribe to channels of AngularJS and NgEurope Stay up to date with the NG-Newsletter “click it”