SlideShare a Scribd company logo
AngularJS 1.x
Training
Roberto Ramadhin
May 2017
AngularJS 1.x
Your trainer
Why AngularJS?
AngularJS is a framework which … extends HTML with new attributes
… is perfect for single-page applications
… reduces complexity
… keeps your JavaScript code maintainable
… and much more
What is AngularJS?
MVC or MV* framework
Design pattern
Separation of concerns
Improves readability & maintainability
What is AngularJS?
Conceptual overview
Template Directives Model Scope Expressions Compiler
Filter View Data binding Controller Dependency Injection
Injector Module Service
https://docs.angularjs.org/guide/concepts
How to use AngularJS?
Let’s setup our local development environment
1. Go to plnkr.co
2. Launch the Editor
3. Add AngularJS (1.6.x)
4. Add Bootstrap CSS (latest)
How to use AngularJS?
Modules & Directives
Let’s build our first application
1. Register a new Angular application using angular.module()
2. Load the application using the ng-app directive
3. Verify the application works by using ng-init and expressions
https://docs.angularjs.org/api
How to use AngularJS?
Data-binding
Synchronizing between the model and the view
<p>Name: <input type="text" ng-model="name"></p>
<p ng-bind="name"></p>
How to use AngularJS?
Controllers & Scope
Control the data of an AngularJS application
app.controller(‘myController’, function() {
});
<div ng-controller=“myController”>
</div>
JavaScript HTML
Control the data of an AngularJS application
app.controller(‘myController’,
function($scope) {
$scope.name = ‘Roberto’;
});
<div ng-controller=“myController”>
<p ng-bind=“name”> </p>
</div>
JavaScript HTML
$scope glues it together
How to use AngularJS?
Controllers & Scope
How to use AngularJS?
Exercise
Create invoice app to calculate quantity * cost
Invoice
Quantity:
Cost:
Total: $2.00
1
2
Tip: Use ng-model on the inputs and an expression for the total
How to use AngularJS?
Filters
Are used to control the representation of data
Explore more filters
https://docs.angularjs.org/api/ng/filter
Expression
{{ name | uppercase }}
{{ amount | currency }}
Using $filter service
$filter(‘uppercase’)(name)
$filter(‘amount’)(currency)
How to use AngularJS?
Exercise
How to create your own filter
Filter guide
https://docs.angularjs.org/guide/filter
Assignment
Create a custom filter that Capitalizes the first letter of a string
So that ‘rotterdam’ becomes ‘Rotterdam’
Hint - your filter should:
return string.charAt(0).toUpperCase() + string.slice(1);
How to use AngularJS?
Dependency Injection
Allows program designs to be loosely coupled
Application
1
Services Filters
Application
2
Services Filters
How to use AngularJS?
Exercise
Separate the filters of your application for re-use
Dependency Injection guide
https://docs.angularjs.org/guide/di
Assignment
1. Create a new file called filters.js
2. Create new module
3. Move filter logic to new module
4. Add dependency in main app
How to use AngularJS?
Built-in directives
ng-repeat instantiates a template once per item from a collection
Model
[‘volkswagen’, ‘audi’, ‘mercedes’, ‘bmw’]
View
• Volkswagen
• Audi
• Mercedes
• BMW
How to use AngularJS?
Built-in directives
ng-repeat instantiates a template once per item from a collection
Model
[
{name: ‘iPhone 7’, price: 650},
{name: ‘Galaxy S8’, price: 730},
{name: ‘OnePlus 3T’, price: 440}
]
View
Name Price
iPhone 7 650
Galaxy S8 730
OnePlus 3T 440
https://www.w3schools.com/angular/angular_directives.asp
How to use AngularJS?
Exercise
Use ng-repeat in combination with filters: currency & orderBy
View
Name Price
OnePlus 3T $ 440
iPhone 7 $ 650
Galaxy S8 $ 730
Order by price
No decimals
https://www.w3schools.com/angular/ng_filter_orderby.asp
How to use AngularJS?
Services
Sharing data and/or functionality across controllers and modules
Built-in services (+/- 30)
$location, $http, $filter, …
Build your own
app.service(‘myService’, function () {
this.myMethod = function () {
return something;
}
});
https://docs.angularjs.org/api/ng/service
How to use AngularJS?
Exercise
Build a tax calculation service
Hint – your method should: return price + (price*vat)
View
Name Price Price (incl. VAT)
OnePlus 3T $ 440 $ 532
iPhone 7 $ 650 $ 787
Galaxy S8 $ 730 $ 883
Service
Includes a variable VAT = 0.21 (21%)
Includes a method which calculates the
totalPrice
How to use AngularJS?
Exercise
Add a ‘filter’ filter to search through results
https://www.w3schools.com/angular/angular_filters.asp
View
Search:
Name Price Price (incl. VAT)
iPhone 7 $ 650 $ 787
iPho
Use ng-model for two-way data binding
How to use AngularJS?
Custom directives
Create reusable DOM components
https://www.sitepoint.com/practical-guide-angularjs-directives/
How to use AngularJS?
DOM Control & Events
Essential to provide a good user experience
https://www.w3schools.com/angular/angular_htmldom.asp
ng-disabled ng-show ng-hide
ng-click ng-blur ng-mouseover
How to use AngularJS?
$http
A service to read data from (remote) servers
https://www.w3schools.com/angular/angular_http.asp
Let’s externalize our data
How to use AngularJS?
Routing
Managing states in your application
Step1:
Data entry
Step 2:
Choose product
Step 3:
Confirmation
https://github.com/angular-ui/ui-router
How to use AngularJS?
Practice
Follow this tutorial to practice your skills
https://www.codeschool.com/courses/shaping-up-with-angularjs
References
W3Schools AngularJS
https://www.w3schools.com/angular/default.asp
AngularJS Conceptual Overview
https://docs.angularjs.org/guide/concepts
What is the difference between AngularJs and Angular 2?
https://www.quora.com/What-is-the-difference-between-AngularJs-and-Angular-2
Where to look for more
information?

More Related Content

What's hot

Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
David Parsons
 
Angularjs PPT
Angularjs PPTAngularjs PPT
Angularjs PPT
Amit Baghel
 
AngularJS Beginners Workshop
AngularJS Beginners WorkshopAngularJS Beginners Workshop
AngularJS Beginners Workshop
Sathish VJ
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: Introduction
Oleksii Prohonnyi
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
Phan Tuan
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
Imtiyaz Ahmad Khan
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS intro
dizabl
 
AngularJS
AngularJSAngularJS
AngularJS
Ermir Hoxhaj
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS
OrisysIndia
 
Advanced AngularJS Concepts
Advanced AngularJS ConceptsAdvanced AngularJS Concepts
Advanced AngularJS Concepts
Kyle Hodgson
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
Narek Mamikonyan
 
Dive into Angular, part 4: Angular 2.0
Dive into Angular, part 4: Angular 2.0Dive into Angular, part 4: Angular 2.0
Dive into Angular, part 4: Angular 2.0
Oleksii Prohonnyi
 
Controllers in AngularJs
Controllers in AngularJsControllers in AngularJs
Controllers in AngularJs
K Arunkumar
 
Angular.js interview questions
Angular.js interview questionsAngular.js interview questions
Angular.js interview questions
codeandyou forums
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
Munir Hoque
 
Start your journey with angular | Basic Angular
Start your journey with angular | Basic AngularStart your journey with angular | Basic Angular
Start your journey with angular | Basic Angular
Anwarul Islam
 
Dive into Angular, part 3: Performance
Dive into Angular, part 3: PerformanceDive into Angular, part 3: Performance
Dive into Angular, part 3: Performance
Oleksii Prohonnyi
 
Angular js
Angular jsAngular js
Angular js
ParmarAnisha
 
Starting with angular js
Starting with angular js Starting with angular js
Starting with angular js
jagriti srivastava
 
Angularjs
AngularjsAngularjs
Angularjs
Sabin Tamrakar
 

What's hot (20)

Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Angularjs PPT
Angularjs PPTAngularjs PPT
Angularjs PPT
 
AngularJS Beginners Workshop
AngularJS Beginners WorkshopAngularJS Beginners Workshop
AngularJS Beginners Workshop
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: Introduction
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS intro
 
AngularJS
AngularJSAngularJS
AngularJS
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS
 
Advanced AngularJS Concepts
Advanced AngularJS ConceptsAdvanced AngularJS Concepts
Advanced AngularJS Concepts
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 
Dive into Angular, part 4: Angular 2.0
Dive into Angular, part 4: Angular 2.0Dive into Angular, part 4: Angular 2.0
Dive into Angular, part 4: Angular 2.0
 
Controllers in AngularJs
Controllers in AngularJsControllers in AngularJs
Controllers in AngularJs
 
Angular.js interview questions
Angular.js interview questionsAngular.js interview questions
Angular.js interview questions
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
 
Start your journey with angular | Basic Angular
Start your journey with angular | Basic AngularStart your journey with angular | Basic Angular
Start your journey with angular | Basic Angular
 
Dive into Angular, part 3: Performance
Dive into Angular, part 3: PerformanceDive into Angular, part 3: Performance
Dive into Angular, part 3: Performance
 
Angular js
Angular jsAngular js
Angular js
 
Starting with angular js
Starting with angular js Starting with angular js
Starting with angular js
 
Angularjs
AngularjsAngularjs
Angularjs
 

Similar to AngularJS 1.x training

Angular js slides
Angular js slidesAngular js slides
Angular js slides
Amr Abd El Latief
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
murtazahaveliwala
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
Ran Wahle
 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
Vipin Mundayad
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs Workshop
Ran Wahle
 
Angular js workshop
Angular js workshopAngular js workshop
Angular js workshop
Rolands Krumbergs
 
GDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopGDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and Workshop
Drew Morris
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics
Ravindra K
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
Mohamad Al Asmar
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
Anuradha Bandara
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
EPAM Systems
 
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
AngularJs Superheroic JavaScript MVW Framework Services by Miracle StudiosAngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
Learnimtactics
 
Angular Framework ppt for beginners and advanced
Angular Framework ppt for beginners and advancedAngular Framework ppt for beginners and advanced
Angular Framework ppt for beginners and advanced
Preetha Ganapathi
 
AngularJS = Browser applications on steroids
AngularJS = Browser applications on steroidsAngularJS = Browser applications on steroids
AngularJS = Browser applications on steroidsMaurice De Beijer [MVP]
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project Report
Kodexhub
 
Angular tutorial
Angular tutorialAngular tutorial
Angular tutorial
Rohit Gupta
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
Ravi Mone
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
Mindfire Solutions
 

Similar to AngularJS 1.x training (20)

Angular js slides
Angular js slidesAngular js slides
Angular js slides
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
 
AngularJS
AngularJS AngularJS
AngularJS
 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs Workshop
 
Angular js workshop
Angular js workshopAngular js workshop
Angular js workshop
 
GDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopGDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and Workshop
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
 
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
AngularJs Superheroic JavaScript MVW Framework Services by Miracle StudiosAngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
 
Angular Framework ppt for beginners and advanced
Angular Framework ppt for beginners and advancedAngular Framework ppt for beginners and advanced
Angular Framework ppt for beginners and advanced
 
AngularJS = Browser applications on steroids
AngularJS = Browser applications on steroidsAngularJS = Browser applications on steroids
AngularJS = Browser applications on steroids
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project Report
 
Angular tutorial
Angular tutorialAngular tutorial
Angular tutorial
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
 

Recently uploaded

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 

Recently uploaded (20)

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 

AngularJS 1.x training

  • 3. Why AngularJS? AngularJS is a framework which … extends HTML with new attributes … is perfect for single-page applications … reduces complexity … keeps your JavaScript code maintainable … and much more
  • 4. What is AngularJS? MVC or MV* framework Design pattern Separation of concerns Improves readability & maintainability
  • 5. What is AngularJS? Conceptual overview Template Directives Model Scope Expressions Compiler Filter View Data binding Controller Dependency Injection Injector Module Service https://docs.angularjs.org/guide/concepts
  • 6. How to use AngularJS? Let’s setup our local development environment 1. Go to plnkr.co 2. Launch the Editor 3. Add AngularJS (1.6.x) 4. Add Bootstrap CSS (latest)
  • 7. How to use AngularJS? Modules & Directives Let’s build our first application 1. Register a new Angular application using angular.module() 2. Load the application using the ng-app directive 3. Verify the application works by using ng-init and expressions https://docs.angularjs.org/api
  • 8. How to use AngularJS? Data-binding Synchronizing between the model and the view <p>Name: <input type="text" ng-model="name"></p> <p ng-bind="name"></p>
  • 9. How to use AngularJS? Controllers & Scope Control the data of an AngularJS application app.controller(‘myController’, function() { }); <div ng-controller=“myController”> </div> JavaScript HTML
  • 10. Control the data of an AngularJS application app.controller(‘myController’, function($scope) { $scope.name = ‘Roberto’; }); <div ng-controller=“myController”> <p ng-bind=“name”> </p> </div> JavaScript HTML $scope glues it together How to use AngularJS? Controllers & Scope
  • 11. How to use AngularJS? Exercise Create invoice app to calculate quantity * cost Invoice Quantity: Cost: Total: $2.00 1 2 Tip: Use ng-model on the inputs and an expression for the total
  • 12. How to use AngularJS? Filters Are used to control the representation of data Explore more filters https://docs.angularjs.org/api/ng/filter Expression {{ name | uppercase }} {{ amount | currency }} Using $filter service $filter(‘uppercase’)(name) $filter(‘amount’)(currency)
  • 13. How to use AngularJS? Exercise How to create your own filter Filter guide https://docs.angularjs.org/guide/filter Assignment Create a custom filter that Capitalizes the first letter of a string So that ‘rotterdam’ becomes ‘Rotterdam’ Hint - your filter should: return string.charAt(0).toUpperCase() + string.slice(1);
  • 14. How to use AngularJS? Dependency Injection Allows program designs to be loosely coupled Application 1 Services Filters Application 2 Services Filters
  • 15. How to use AngularJS? Exercise Separate the filters of your application for re-use Dependency Injection guide https://docs.angularjs.org/guide/di Assignment 1. Create a new file called filters.js 2. Create new module 3. Move filter logic to new module 4. Add dependency in main app
  • 16. How to use AngularJS? Built-in directives ng-repeat instantiates a template once per item from a collection Model [‘volkswagen’, ‘audi’, ‘mercedes’, ‘bmw’] View • Volkswagen • Audi • Mercedes • BMW
  • 17. How to use AngularJS? Built-in directives ng-repeat instantiates a template once per item from a collection Model [ {name: ‘iPhone 7’, price: 650}, {name: ‘Galaxy S8’, price: 730}, {name: ‘OnePlus 3T’, price: 440} ] View Name Price iPhone 7 650 Galaxy S8 730 OnePlus 3T 440 https://www.w3schools.com/angular/angular_directives.asp
  • 18. How to use AngularJS? Exercise Use ng-repeat in combination with filters: currency & orderBy View Name Price OnePlus 3T $ 440 iPhone 7 $ 650 Galaxy S8 $ 730 Order by price No decimals https://www.w3schools.com/angular/ng_filter_orderby.asp
  • 19. How to use AngularJS? Services Sharing data and/or functionality across controllers and modules Built-in services (+/- 30) $location, $http, $filter, … Build your own app.service(‘myService’, function () { this.myMethod = function () { return something; } }); https://docs.angularjs.org/api/ng/service
  • 20. How to use AngularJS? Exercise Build a tax calculation service Hint – your method should: return price + (price*vat) View Name Price Price (incl. VAT) OnePlus 3T $ 440 $ 532 iPhone 7 $ 650 $ 787 Galaxy S8 $ 730 $ 883 Service Includes a variable VAT = 0.21 (21%) Includes a method which calculates the totalPrice
  • 21. How to use AngularJS? Exercise Add a ‘filter’ filter to search through results https://www.w3schools.com/angular/angular_filters.asp View Search: Name Price Price (incl. VAT) iPhone 7 $ 650 $ 787 iPho Use ng-model for two-way data binding
  • 22. How to use AngularJS? Custom directives Create reusable DOM components https://www.sitepoint.com/practical-guide-angularjs-directives/
  • 23. How to use AngularJS? DOM Control & Events Essential to provide a good user experience https://www.w3schools.com/angular/angular_htmldom.asp ng-disabled ng-show ng-hide ng-click ng-blur ng-mouseover
  • 24. How to use AngularJS? $http A service to read data from (remote) servers https://www.w3schools.com/angular/angular_http.asp Let’s externalize our data
  • 25. How to use AngularJS? Routing Managing states in your application Step1: Data entry Step 2: Choose product Step 3: Confirmation https://github.com/angular-ui/ui-router
  • 26. How to use AngularJS? Practice Follow this tutorial to practice your skills https://www.codeschool.com/courses/shaping-up-with-angularjs
  • 27. References W3Schools AngularJS https://www.w3schools.com/angular/default.asp AngularJS Conceptual Overview https://docs.angularjs.org/guide/concepts What is the difference between AngularJs and Angular 2? https://www.quora.com/What-is-the-difference-between-AngularJs-and-Angular-2 Where to look for more information?

Editor's Notes

  1. Data-binding, dependency injection, DOM manipulation => all handled implicitly by AngularJS | Model View Controller | Components | Backed by Google
  2. MV*
  3. {{ name }}  {{ 5 + 5 }}
  4. Two-way data-binding
  5. Controller makes/changes/removes/controls the data
  6. Don’t implement the filter yet. This will be covered in the next slide.
  7. Share data and/or functionality across controllers and modules
  8. Share data and/or functionality across controllers and modules
  9. Share data and/or functionality across controllers and modules
  10. Create custom elements | Encapsulation | Components | DRY
  11. AngularJS has directives for binding application data to the attributes of HTML DOM elements | Responding to events
  12. Make a call to a remote server for data
  13. Manual state management using variables to keep track of step, and div’s with ng-show/ng-hide | https://ui-router.github.io/ng1/tutorial/helloworld
  14. Make a call to a remote server for data