SlideShare a Scribd company logo
1
AngularJS - CloudVis Technology
AngularJS Framework
Tăng Phú
phutang@cloudvis.vn
Technical Leader @ CloudVis Technology
2
AngularJS - CloudVis Technology
Agenda
Introduction to AngularJS
Anatomy of an AngularJS application
Communicating with Servers
Custom Directives (advanced)
3
AngularJS - CloudVis Technology
Introduction to AngularJS
Angular Team @ Google
4
AngularJS - CloudVis Technology
Introduction to AngularJS
Experiences from building large web applications
like Gmail, Maps, Canlendar …
Open Source Javascript Framework
Use
MVC architecture
Data binding
Client side templates
Dependency injection
5
AngularJS - CloudVis Technology
Introduction to AngularJS
hello-world.html
hello_controller.js
6
AngularJS - CloudVis Technology
Introduction to AngularJS
Result Hello, World
A few interesting things
Bind with no classes, no IDs in HTML
No register events
hello_controller.js is plain JavaScript class
Auto inject $scope
Auto init HelloController
7
AngularJS - CloudVis Technology
Introduction to AngularJS
Data Binding
8
AngularJS - CloudVis Technology
Introduction to AngularJS
Result
Type: Hi
9
AngularJS - CloudVis Technology
Anatomy of an AngularJS application
Structure – Basic workflow
10
AngularJS - CloudVis Technology
Anatomy of an AngularJS application
● Line 2: define a part of DOM which is managed by Angular
● Line 5, 6: import library and your code
● Line 9: define scope (what's scope?) and bind with
HelloController, ng-controller attribute
● Line 10: define data with ng-model attribute
● Line 11: display text with {{ }}
● Line 12: behavior with ng-click attribute
11
AngularJS - CloudVis Technology
Basic startup flow
User requests a first page
Load a index.html page with template
Wait for the page fullly loaded, and looks ng-app
Scan binding and directives (what's directive?)
Connect to server to load additional data (call ajax to get
data)
12
AngularJS - CloudVis Technology
Basic startup flow
Images from http://docs.angularjs.org/guide/concepts
13
AngularJS - CloudVis Technology
What's Directive?
Kinds of Directive
E - Element name: <my-directive></my-directive>
A - Attribute: <div my-directive="exp"> </div>
C - Class: <div class="my-directive: exp;"></div>
M - Comment: <!-- directive: my-directive exp -->
Built-in Directive
ng-app (A)
ng-controller (A, C)
ng-model (A, C)
ng-change (E, A)
ng-click (A, C)
ng-repeat (A, C)
….
Ref: http://docs.angularjs.org/api/
14
AngularJS - CloudVis Technology
Directive Example
<p ng-bind="greeting"></p>
<form ng-controller="SomeController">
<input type="checkbox" ng-model="youCheckedIt">
</form>
<form ng-submit="requestFunding()"
ng-controller="StartUpController">
Starting: <input ng-change="computeNeeded()"
ng-model="startingEstimate">
Recommendation: {{needed}}
<button>Fund my startup!</button>
<button ng-click="reset()">Reset</button>
</form>
15
AngularJS - CloudVis Technology
What's Scope?
Scope as Data-Model
The glue between application controller and the view
Both controllers and directives have reference to the scope,
but not to each other.
16
AngularJS - CloudVis Technology
What's Controller?
A controller is a JavaScript function that is used to augment
instances of angular Scope
Use controllers to
Set up the initial state of a scope object.
Add behavior to the scope object.
17
AngularJS - CloudVis Technology
What's View?
To generate the View (render a DOM), AngularJS gathers
information from Template, applies Controller functions, link
Model properties
18
AngularJS - CloudVis Technology
Integration
19
AngularJS - CloudVis Technology
Data Binding
In the Angular implementation of MVC, the view has
knowledge of both the model and the controller.
The view knows about the model where two-way data-binding
occurs
Images from http://docs.angularjs.org/guide/dev_guide.templates.databinding
Classical Template Systems Angular Templates
20
AngularJS - CloudVis Technology
Communicating with Servers
21
AngularJS - CloudVis Technology
Communicating with Servers
AngularJS support
$http
General usage
Shortcut methods
$http.get() $http.head() $http.post() $http.put()
$http.delete() $http.jsonp()
22
AngularJS - CloudVis Technology
Communicating with Servers
$resource (Dependencies on $http)
23
AngularJS - CloudVis Technology
Communicating with Servers
var data = Data.get({id:123}, function() {
data.isDefault = true;
data.$save();
});
{ 'get': {method:'GET'},
'save': {method:'POST'},
'query': {method:'GET', isArray:true},
'remove': {method:'DELETE'},
'delete': {method:'DELETE'} };
$resource (Dependencies on $http)
24
AngularJS - CloudVis Technology
Custom Directives (advanced)
E - Element name: <my-directive></my-directive>
A - Attribute: <div my-directive="exp"> </div>
C - Class: <div class="my-directive: exp;"></div>
M - Comment: <!-- directive: my-directive exp -->
25
AngularJS - CloudVis Technology
Writing directives
26
AngularJS - CloudVis Technology
Wrapper DataTables
DataTables
(plug-in for jQuery)
27
AngularJS - CloudVis Technology
Wrapper DataTables
DataTables (plug-in for jQuery)
Import DataTables jQuery
<script
type="text/javascript"
src="jquery.dataTables.js">
</script>
In Template
<cv-table
ajax-url="/data/users"
page-size="50">
</cv-table>
28
AngularJS - CloudVis Technology
References
http://angularjs.org/
Ebook: AngularJS, Oreilly, Apr 2013
29
AngularJS - CloudVis Technology
Thank you

More Related Content

What's hot (20)

PPTX
AngularJS in 60ish Minutes
Dan Wahlin
 
PPTX
AngularJS Internal
Eyal Vardi
 
PPTX
Angularjs Basics
Anuradha Bandara
 
PPTX
Angular js
Behind D Walls
 
PPTX
The AngularJS way
Boyan Mihaylov
 
PPTX
Angular js architecture (v1.4.8)
Gabi Costel Lapusneanu
 
PDF
Introduction to AngularJS
Jussi Pohjolainen
 
PDF
AngularJS Project Setup step-by- step guide - RapidValue Solutions
RapidValue
 
PDF
AngularJS best-practices
Henry Tao
 
PDF
AngularJS: an introduction
Luigi De Russis
 
PPTX
AngularJS with TypeScript and Windows Azure Mobile Services
Rainer Stropek
 
PPTX
AngularJS Directives
Eyal Vardi
 
PPTX
AngularJs $provide API internals & circular dependency problem.
Yan Yankowski
 
PDF
GDayX - Advanced Angular.JS
Nicolas Embleton
 
PPTX
Angular js
Manav Prasad
 
PPTX
AngularJS Animations
Eyal Vardi
 
PDF
Building scalable applications with angular js
Andrew Alpert
 
PPTX
Building an End-to-End AngularJS Application
Dan Wahlin
 
PDF
AngularJS introduction
Tania Gonzales
 
PDF
Workshop 12: AngularJS Parte I
Visual Engineering
 
AngularJS in 60ish Minutes
Dan Wahlin
 
AngularJS Internal
Eyal Vardi
 
Angularjs Basics
Anuradha Bandara
 
Angular js
Behind D Walls
 
The AngularJS way
Boyan Mihaylov
 
Angular js architecture (v1.4.8)
Gabi Costel Lapusneanu
 
Introduction to AngularJS
Jussi Pohjolainen
 
AngularJS Project Setup step-by- step guide - RapidValue Solutions
RapidValue
 
AngularJS best-practices
Henry Tao
 
AngularJS: an introduction
Luigi De Russis
 
AngularJS with TypeScript and Windows Azure Mobile Services
Rainer Stropek
 
AngularJS Directives
Eyal Vardi
 
AngularJs $provide API internals & circular dependency problem.
Yan Yankowski
 
GDayX - Advanced Angular.JS
Nicolas Embleton
 
Angular js
Manav Prasad
 
AngularJS Animations
Eyal Vardi
 
Building scalable applications with angular js
Andrew Alpert
 
Building an End-to-End AngularJS Application
Dan Wahlin
 
AngularJS introduction
Tania Gonzales
 
Workshop 12: AngularJS Parte I
Visual Engineering
 

Viewers also liked (14)

PDF
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
 
PPTX
Introduction to Angularjs
Manish Shekhawat
 
ODP
History of JavaScript
Rajat Saxena
 
PPT
Java Script - Module I
Mustafa Qamar-ud-Din
 
PDF
Discover AngularJS
Fabien Vauchelles
 
PPT
Let your website a ride of AngularJS
Mike Taylor
 
PDF
Spring Bootで変わる Javaアプリ開発! #jsug
Toshiaki Maki
 
PDF
Deploying Spring Boot applications with Docker (east bay cloud meetup dec 2014)
Chris Richardson
 
PPTX
Benefits of developing single page web applications using angular js
Harbinger Systems - HRTech Builder of Choice
 
PDF
AngularJS application architecture
Gabriele Falace
 
PDF
AngularJS - What is it & Why is it awesome ? (with demos)
Gary Arora
 
PDF
Spring Boot - Uma app do 0 a Web em 30 minutos
phelypploch
 
PDF
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
🎤 Hanno Embregts 🎸
 
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
 
Introduction to Angularjs
Manish Shekhawat
 
History of JavaScript
Rajat Saxena
 
Java Script - Module I
Mustafa Qamar-ud-Din
 
Discover AngularJS
Fabien Vauchelles
 
Let your website a ride of AngularJS
Mike Taylor
 
Spring Bootで変わる Javaアプリ開発! #jsug
Toshiaki Maki
 
Deploying Spring Boot applications with Docker (east bay cloud meetup dec 2014)
Chris Richardson
 
Benefits of developing single page web applications using angular js
Harbinger Systems - HRTech Builder of Choice
 
AngularJS application architecture
Gabriele Falace
 
AngularJS - What is it & Why is it awesome ? (with demos)
Gary Arora
 
Spring Boot - Uma app do 0 a Web em 30 minutos
phelypploch
 
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
🎤 Hanno Embregts 🎸
 
Ad

Similar to AngularJS Framework (20)

PDF
AngularJS By Vipin
Vipin Mundayad
 
PPTX
Angular js
vu van quyet
 
PPTX
Angular Javascript Tutorial with command
ssuser42b933
 
PDF
Introduction to AngularJS By Bharat Makwana
Bharat Makwana
 
PPTX
Angular js
Steve Fort
 
PDF
Getting Started with AngularJS
Edureka!
 
PDF
Getting Started With AngularJS
Edureka!
 
PPTX
AngularJS = Browser applications on steroids
Maurice De Beijer [MVP]
 
PDF
AngularJS for Beginners
Edureka!
 
PPTX
Angular Js Get Started - Complete Course
EPAM Systems
 
PPTX
Training On Angular Js
Mahima Radhakrishnan
 
PPTX
Introduction to AngularJS
Shyjal Raazi
 
PPTX
Introduction to single page application with angular js
Mindfire Solutions
 
PPTX
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
murtazahaveliwala
 
PPTX
Kalp Corporate Angular Js Tutorials
Kalp Corporate
 
PPTX
Learning AngularJS - Complete coverage of AngularJS features and concepts
Suresh Patidar
 
PDF
AngularJS
Hiten Pratap Singh
 
PPTX
Intoduction to Angularjs
Gaurav Agrawal
 
PPTX
AngularJS Fundamentals + WebAPI
Eric Wise
 
AngularJS By Vipin
Vipin Mundayad
 
Angular js
vu van quyet
 
Angular Javascript Tutorial with command
ssuser42b933
 
Introduction to AngularJS By Bharat Makwana
Bharat Makwana
 
Angular js
Steve Fort
 
Getting Started with AngularJS
Edureka!
 
Getting Started With AngularJS
Edureka!
 
AngularJS = Browser applications on steroids
Maurice De Beijer [MVP]
 
AngularJS for Beginners
Edureka!
 
Angular Js Get Started - Complete Course
EPAM Systems
 
Training On Angular Js
Mahima Radhakrishnan
 
Introduction to AngularJS
Shyjal Raazi
 
Introduction to single page application with angular js
Mindfire Solutions
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
murtazahaveliwala
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate
 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Suresh Patidar
 
Intoduction to Angularjs
Gaurav Agrawal
 
AngularJS Fundamentals + WebAPI
Eric Wise
 
Ad

Recently uploaded (20)

PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
PDF
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
PPTX
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
PDF
Open Source Milvus Vector Database v 2.6
Zilliz
 
PPTX
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PDF
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Priyanka Aash
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Kubernetes - Architecture & Components.pdf
geethak285
 
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
Open Source Milvus Vector Database v 2.6
Zilliz
 
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Priyanka Aash
 

AngularJS Framework

  • 1. 1 AngularJS - CloudVis Technology AngularJS Framework Tăng Phú [email protected] Technical Leader @ CloudVis Technology
  • 2. 2 AngularJS - CloudVis Technology Agenda Introduction to AngularJS Anatomy of an AngularJS application Communicating with Servers Custom Directives (advanced)
  • 3. 3 AngularJS - CloudVis Technology Introduction to AngularJS Angular Team @ Google
  • 4. 4 AngularJS - CloudVis Technology Introduction to AngularJS Experiences from building large web applications like Gmail, Maps, Canlendar … Open Source Javascript Framework Use MVC architecture Data binding Client side templates Dependency injection
  • 5. 5 AngularJS - CloudVis Technology Introduction to AngularJS hello-world.html hello_controller.js
  • 6. 6 AngularJS - CloudVis Technology Introduction to AngularJS Result Hello, World A few interesting things Bind with no classes, no IDs in HTML No register events hello_controller.js is plain JavaScript class Auto inject $scope Auto init HelloController
  • 7. 7 AngularJS - CloudVis Technology Introduction to AngularJS Data Binding
  • 8. 8 AngularJS - CloudVis Technology Introduction to AngularJS Result Type: Hi
  • 9. 9 AngularJS - CloudVis Technology Anatomy of an AngularJS application Structure – Basic workflow
  • 10. 10 AngularJS - CloudVis Technology Anatomy of an AngularJS application ● Line 2: define a part of DOM which is managed by Angular ● Line 5, 6: import library and your code ● Line 9: define scope (what's scope?) and bind with HelloController, ng-controller attribute ● Line 10: define data with ng-model attribute ● Line 11: display text with {{ }} ● Line 12: behavior with ng-click attribute
  • 11. 11 AngularJS - CloudVis Technology Basic startup flow User requests a first page Load a index.html page with template Wait for the page fullly loaded, and looks ng-app Scan binding and directives (what's directive?) Connect to server to load additional data (call ajax to get data)
  • 12. 12 AngularJS - CloudVis Technology Basic startup flow Images from http://docs.angularjs.org/guide/concepts
  • 13. 13 AngularJS - CloudVis Technology What's Directive? Kinds of Directive E - Element name: <my-directive></my-directive> A - Attribute: <div my-directive="exp"> </div> C - Class: <div class="my-directive: exp;"></div> M - Comment: <!-- directive: my-directive exp --> Built-in Directive ng-app (A) ng-controller (A, C) ng-model (A, C) ng-change (E, A) ng-click (A, C) ng-repeat (A, C) …. Ref: http://docs.angularjs.org/api/
  • 14. 14 AngularJS - CloudVis Technology Directive Example <p ng-bind="greeting"></p> <form ng-controller="SomeController"> <input type="checkbox" ng-model="youCheckedIt"> </form> <form ng-submit="requestFunding()" ng-controller="StartUpController"> Starting: <input ng-change="computeNeeded()" ng-model="startingEstimate"> Recommendation: {{needed}} <button>Fund my startup!</button> <button ng-click="reset()">Reset</button> </form>
  • 15. 15 AngularJS - CloudVis Technology What's Scope? Scope as Data-Model The glue between application controller and the view Both controllers and directives have reference to the scope, but not to each other.
  • 16. 16 AngularJS - CloudVis Technology What's Controller? A controller is a JavaScript function that is used to augment instances of angular Scope Use controllers to Set up the initial state of a scope object. Add behavior to the scope object.
  • 17. 17 AngularJS - CloudVis Technology What's View? To generate the View (render a DOM), AngularJS gathers information from Template, applies Controller functions, link Model properties
  • 18. 18 AngularJS - CloudVis Technology Integration
  • 19. 19 AngularJS - CloudVis Technology Data Binding In the Angular implementation of MVC, the view has knowledge of both the model and the controller. The view knows about the model where two-way data-binding occurs Images from http://docs.angularjs.org/guide/dev_guide.templates.databinding Classical Template Systems Angular Templates
  • 20. 20 AngularJS - CloudVis Technology Communicating with Servers
  • 21. 21 AngularJS - CloudVis Technology Communicating with Servers AngularJS support $http General usage Shortcut methods $http.get() $http.head() $http.post() $http.put() $http.delete() $http.jsonp()
  • 22. 22 AngularJS - CloudVis Technology Communicating with Servers $resource (Dependencies on $http)
  • 23. 23 AngularJS - CloudVis Technology Communicating with Servers var data = Data.get({id:123}, function() { data.isDefault = true; data.$save(); }); { 'get': {method:'GET'}, 'save': {method:'POST'}, 'query': {method:'GET', isArray:true}, 'remove': {method:'DELETE'}, 'delete': {method:'DELETE'} }; $resource (Dependencies on $http)
  • 24. 24 AngularJS - CloudVis Technology Custom Directives (advanced) E - Element name: <my-directive></my-directive> A - Attribute: <div my-directive="exp"> </div> C - Class: <div class="my-directive: exp;"></div> M - Comment: <!-- directive: my-directive exp -->
  • 25. 25 AngularJS - CloudVis Technology Writing directives
  • 26. 26 AngularJS - CloudVis Technology Wrapper DataTables DataTables (plug-in for jQuery)
  • 27. 27 AngularJS - CloudVis Technology Wrapper DataTables DataTables (plug-in for jQuery) Import DataTables jQuery <script type="text/javascript" src="jquery.dataTables.js"> </script> In Template <cv-table ajax-url="/data/users" page-size="50"> </cv-table>
  • 28. 28 AngularJS - CloudVis Technology References http://angularjs.org/ Ebook: AngularJS, Oreilly, Apr 2013
  • 29. 29 AngularJS - CloudVis Technology Thank you