SlideShare a Scribd company logo
1 of 30
Download to read offline
AngularJS is super cool.
By Max.
AngularJS is MVW.
Which is:
•  Model
•  View
•  WTF? — Whatever
Source: https://plus.google.com/+AngularJS/posts/aZNVhj355G2
Igor Minar
Whatever?
— I'd rather see developers build kick-ass apps that are well-designed
and follow separation of concerns, than see them waste time arguing about
MV* nonsense. And for this reason, I hereby declare AngularJS to be MVW
framework — Model-View-Whatever. Where Whatever stands for
“whatever works for you”.
“
Core concepts
Core concepts
Template HTML and ...
Directive ... a few new attributes*.
* With a powerful backend.
Model Just data, nothing more.
Scope A context where the model is used.
The center of the Angular Universe.
Expressions Access to data and functions in the scope.
...
6
Core concepts
...
Filter Formatting and filtering.
Controller Business logic, related to View layer.
Service Reusable business logic, not related with View layer.
Module Container for all this stuff.
Find out more in the Conceptual Overview.
7
Two-way binding
... in Classical Template Systems ... in Angular Templates
Data Binding ...
9
Two-way binding example
Enter something:
You've entered:
<div data-ng-app>
<label>Enter something:</label>
<input type="text" data-ng-model="something" />
<p>You've entered: <strong>{{ something }}</strong></p>
</div>
— No JavaScript. At all.
(supper-dummy)
01.
02.
03.
04.
05.
10
Add contact:
add
All contacts:
[]
Filter by: Filtered:
Two-way binding example
(pro)
(still so dummy)
12
Add contact:
add
All contacts:
[]
Two-way binding example
<div data-ng-controller="example2Controller">
<div>
<label>Add contact:<br>
<input type="text" data-ng-model="newContact" />
</label>
<button data-ng-click="addContact(newContact)">add</button>
<div data-ng-show="displayHelp">
<small>Format is wrong</small>
</div>
</div>
<div>
All contacts:<br><small>{{ contacts | json }}</small>
</div>
<!-- ... -->
</div>
(pro)
(still so dummy)
01.
02.
03.
04.
05.
06.
07.
08.
09.
10.
11.
12.
13.
14.
15.
13
Add contact:
add
All contacts:
[]
Two-way binding example
angular.module("angulardemo")
.controller("example2Controller", function($scope) {
$scope.contacts = [];
$scope.addContact = function(newContact) {
var contact = parseContact(newContact);
if (!contact) {
$scope.displayHelp = true;
return;
}
$scope.contacts.push(contact);
$scope.newContact = "";
$scope.displayHelp = false;
};
// ...
});
(pro)
(still so dummy)
01.
02.
03.
04.
05.
06.
07.
08.
09.
10.
11.
12.
13.
14.
15.
14
Add contact:
add
All contacts:
[]
Two-way binding example
angular.module("angulardemo")
.controller("example2Controller", function($scope) {
// ...
$scope.$watch("newContact", function(newValue, oldValue) {
if (!newValue.length) {
$scope.displayHelp = false;
}
});
});
(pro)
(still so dummy)
01.
02.
03.
04.
05.
06.
07.
08.
09.
10.
15
Add contact:
add
Filter by: Filtered:
Two-way binding example
<input type="text" data-ng-model="query" />
<!-- ... -->
<ul><li data-ng-repeat="contact in contacts | filter:query">
<small>{{ contact | contactInfo }}</small>
</li></ul>
angular.module("angulardemo")
.controller("example2Controller", function($scope) {/* ... */});
.filter("contactInfo", function() {
return function(input) {
var name = input.firstName && input.lastName
? input.firstName + " " + input.lastName : null;
return input.email
? (name ? name + " <" + input.email + ">" : input.email) : name;
}
});
(pro)
(still so dummy)
01.
02.
03.
04.
05.
01.
02.
03.
04.
05.
06.
07.
08.
09.
10.
16
Dependency injection
UAH: USD: 0.00 EUR: 0.00 GBP: 0.00
Dependency injection example
<div>UAH: <input type="text" data-ng-model="amount" /></div>
<div>USD: {{ convert(amount, "UAH", "USD") | number:2 }}</div>
<div>EUR: {{ convert(amount, "UAH", "EUR") | number:2 }}</div>
<div>GBP: {{ convert(amount, "UAH", "GBP") | number:2 }}</div>
angular.module("angulardemo")
.controller("example3Controller", function($scope, ExchangeRateDummy) {
$scope.convert = function(amount, from, to) {
var rate = ExchangeRateDummy.getRate(from, to);
return (parseFloat(amount) || 0) * (rate.rate || 0);
}
});
(dummy)
01.
02.
03.
04.
01.
02.
03.
04.
05.
06.
07.
18
UAH: USD: 0.00 EUR: 0.00 GBP: 0.00
Dependency injection example
angular.module("angulardemo")
.factory("ExchangeRateDummy", function() {
var rates = {
"UAHUSD": { from: "UAH", to: "USD", rate: 0.06 },
"UAHEUR": { from: "UAH", to: "EUR", rate: 0.05 },
"UAHGBP": { from: "UAH", to: "GBP", rate: 0.04 }
};
return {
getRate: function(from, to) {
return (from + to in rates) ? rates[from + to] : {};
}
}
});
(dummy)
01.
02.
03.
04.
05.
06.
07.
08.
09.
10.
11.
12.
13.
19
USD: AUD: 0.00 EUR: 0.00 GBP: 0.00
Dependency injection example
<div>USD: <input type="text" data-ng-model="amount" /></div>
<div>AUD: {{ converted.AUD | number:2 }}</div>
<div>EUR: {{ converted.EUR | number:2 }}</div>
<div>GBP: {{ converted.GBP | number:2 }}</div>
(pro)
01.
02.
03.
04.
20
USD: AUD: 0.00 EUR: 0.00 GBP: 0.00
Dependency injection example
angular.module("angulardemo")
.controller("example4Controller", function($scope, ExchangeRate) {
$scope.converted = {"AUD": 0, "EUR": 0, "GBP": 0};
$scope.$watch("amount", function(amount) {
angular.forEach($scope.converted, function(convertedValue, currency) {
ExchangeRate.getRate("USD", currency).then(function(rate) {
$scope.converted[currency] = (parseFloat(amount) || 0) * (rate || 0);
});
});
});
})
.factory("ExchangeRate", ["$http", function($http) {
var apiUrl = "http://apilayer.net/api/live?access_key=XXX";
return {
getRate: function(from, to) {
var requestUrl = apiUrl + "&source=" + from + "&currencies=" + to
+ "&callback=JSON_CALLBACK";
return $http.jsonp(requestUrl, {cache: true}).then(function(response) {
return response.data.quotes[from + to];
});
}
}
}]);
(pro)
01.
02.
03.
04.
05.
06.
07.
08.
09.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
21
Directives
in a real-life project
Cache manager directive
<!-- app/templates/index.html -->
<footer class="container-fluid">
...
<div data-cache-manager></div>
...
</footer>
01.
02.
03.
04.
05.
06.
24
Cache manager directive
// app/js/modules/agile/directives/cache_manager.js
angular.module("agile.directives")
.directive("cacheManager",
function($templateCache, Storage, Helper, TEMPLATES_URL) {
return {
scope: {},
controller: function ($scope) {
$scope.clear = function() {
$templateCache.removeAll();
Storage.clearAll();
Helper.setAlert("success", "Cache has been cleared.")
}
},
templateUrl: TEMPLATES_URL + "/cache-manager.directive.html"
};
});
<!-- app/templates/cache-manager.directive.html -->
<div class="cache-manager pull-right">
<button type="button" data-ng-click="clear()">Clear Cache</button>
</div>
01.
02.
03.
04.
05.
06.
07.
08.
09.
10.
11.
12.
13.
14.
15.
16.
01.
02.
03.
04.
25
Enough code
Just a few more things
in a conclusion.
Angular Projects
•  https://builtwith.angularjs.org/
•  https://github.com/angular/angular.js/wiki/Projects-using-AngularJS
Angular Projects
•   Kontaktkarte — Contact book
•   Hatjitsu — Distributed online scrum planning poker
•   Semantic Body Browser — A tool for graphically exploring an organism
•   Drugsearch — Android app for searching drugs in dragstores
•   Mapa de personajes de la serie Isabel — The characters map in the
“Isabel” series; ♥
Angular is for:
•  Web apps (single-page apps, mobile apps, browser extensions, etc.)
•  Interactive websites (social networks, content management, admin
panels)
•  Interactive pages (checkout, statistics, graphics, reports, etc.)
•  Fun
•  Blogs
•  News
•  Affiliates
•  Corporate websites
•  E-Commerce
•  Wikis
Angular is not for:
Of course it's not a rule.

More Related Content

What's hot

AngularJS Animations
AngularJS AnimationsAngularJS Animations
AngularJS AnimationsEyal Vardi
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developersKai Koenig
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesRainer Stropek
 
GDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSGDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSNicolas Embleton
 
준비하세요 Angular js 2.0
준비하세요 Angular js 2.0준비하세요 Angular js 2.0
준비하세요 Angular js 2.0Jeado Ko
 
Angular 2.0 Dependency injection
Angular 2.0 Dependency injectionAngular 2.0 Dependency injection
Angular 2.0 Dependency injectionEyal Vardi
 
AngularJS Compile Process
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile ProcessEyal Vardi
 
Building scalable applications with angular js
Building scalable applications with angular jsBuilding scalable applications with angular js
Building scalable applications with angular jsAndrew Alpert
 
Knockoutjs UG meeting presentation
Knockoutjs UG meeting presentationKnockoutjs UG meeting presentation
Knockoutjs UG meeting presentationValdis Iljuconoks
 
droidQuery: The Android port of jQuery
droidQuery: The Android port of jQuerydroidQuery: The Android port of jQuery
droidQuery: The Android port of jQueryPhDBrown
 
Angular 2 NgModule
Angular 2 NgModuleAngular 2 NgModule
Angular 2 NgModuleEyal Vardi
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS DirectivesEyal Vardi
 
[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법Jeado Ko
 

What's hot (20)

The AngularJS way
The AngularJS wayThe AngularJS way
The AngularJS way
 
AngularJS Animations
AngularJS AnimationsAngularJS Animations
AngularJS Animations
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developers
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile Services
 
Angular js
Angular jsAngular js
Angular js
 
GDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSGDayX - Advanced Angular.JS
GDayX - Advanced Angular.JS
 
Backbone Basics with Examples
Backbone Basics with ExamplesBackbone Basics with Examples
Backbone Basics with Examples
 
Mini-Training: AngularJS
Mini-Training: AngularJSMini-Training: AngularJS
Mini-Training: AngularJS
 
AngularJS Basic Training
AngularJS Basic TrainingAngularJS Basic Training
AngularJS Basic Training
 
준비하세요 Angular js 2.0
준비하세요 Angular js 2.0준비하세요 Angular js 2.0
준비하세요 Angular js 2.0
 
Angular 2.0 Dependency injection
Angular 2.0 Dependency injectionAngular 2.0 Dependency injection
Angular 2.0 Dependency injection
 
AngularJS Compile Process
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile Process
 
Building scalable applications with angular js
Building scalable applications with angular jsBuilding scalable applications with angular js
Building scalable applications with angular js
 
Knockoutjs UG meeting presentation
Knockoutjs UG meeting presentationKnockoutjs UG meeting presentation
Knockoutjs UG meeting presentation
 
droidQuery: The Android port of jQuery
droidQuery: The Android port of jQuerydroidQuery: The Android port of jQuery
droidQuery: The Android port of jQuery
 
Angular 2 NgModule
Angular 2 NgModuleAngular 2 NgModule
Angular 2 NgModule
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives
 
Sane Async Patterns
Sane Async PatternsSane Async Patterns
Sane Async Patterns
 
[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법
 

Viewers also liked (12)

RVCC_Final_Draft
RVCC_Final_DraftRVCC_Final_Draft
RVCC_Final_Draft
 
Code securely
Code securelyCode securely
Code securely
 
Starbucks Roasts Green Mountain
Starbucks Roasts Green MountainStarbucks Roasts Green Mountain
Starbucks Roasts Green Mountain
 
W2HTS Press Release - 2
W2HTS Press Release - 2W2HTS Press Release - 2
W2HTS Press Release - 2
 
FinalPatch_REVISED
FinalPatch_REVISEDFinalPatch_REVISED
FinalPatch_REVISED
 
Powerpoint Presentation
Powerpoint PresentationPowerpoint Presentation
Powerpoint Presentation
 
Using traits in PHP
Using traits in PHPUsing traits in PHP
Using traits in PHP
 
Survive with OOP
Survive with OOPSurvive with OOP
Survive with OOP
 
How else can you write the code in PHP?
How else can you write the code in PHP?How else can you write the code in PHP?
How else can you write the code in PHP?
 
EVENTZ Credentials
EVENTZ CredentialsEVENTZ Credentials
EVENTZ Credentials
 
50 shades of PHP
50 shades of PHP50 shades of PHP
50 shades of PHP
 
1.nature and scope of mr
1.nature and scope of mr1.nature and scope of mr
1.nature and scope of mr
 

Similar to Angular.js is super cool

AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014Ran Wahle
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs WorkshopRan Wahle
 
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 StudiosLearnimtactics
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseEPAM Systems
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development GuideNitin Giri
 
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 AngularJSmurtazahaveliwala
 
Angular JS deep dive
Angular JS deep diveAngular JS deep dive
Angular JS deep diveAxilis
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSYoann Gotthilf
 
AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014Dariusz Kalbarczyk
 
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 jsMindfire Solutions
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS BasicsRavi Mone
 
Asp.net mvc training
Asp.net mvc trainingAsp.net mvc training
Asp.net mvc trainingicubesystem
 

Similar to Angular.js is super cool (20)

AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs Workshop
 
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 Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
 
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
 
Angular JS deep dive
Angular JS deep diveAngular JS deep dive
Angular JS deep dive
 
Intro to AngularJs
Intro to AngularJsIntro to AngularJs
Intro to AngularJs
 
AngularJS
AngularJSAngularJS
AngularJS
 
Valentine with AngularJS
Valentine with AngularJSValentine with AngularJS
Valentine with AngularJS
 
AngularJS and SPA
AngularJS and SPAAngularJS and SPA
AngularJS and SPA
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014
 
Asp.NET MVC
Asp.NET MVCAsp.NET MVC
Asp.NET MVC
 
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
 
Angular
AngularAngular
Angular
 
Angular
AngularAngular
Angular
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Asp.net mvc training
Asp.net mvc trainingAsp.net mvc training
Asp.net mvc training
 
AngularJS 1.x training
AngularJS 1.x trainingAngularJS 1.x training
AngularJS 1.x training
 

Recently uploaded

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 

Recently uploaded (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 

Angular.js is super cool

  • 1.
  • 2. AngularJS is super cool. By Max.
  • 3. AngularJS is MVW. Which is: •  Model •  View •  WTF? — Whatever
  • 4. Source: https://plus.google.com/+AngularJS/posts/aZNVhj355G2 Igor Minar Whatever? — I'd rather see developers build kick-ass apps that are well-designed and follow separation of concerns, than see them waste time arguing about MV* nonsense. And for this reason, I hereby declare AngularJS to be MVW framework — Model-View-Whatever. Where Whatever stands for “whatever works for you”. “
  • 6. Core concepts Template HTML and ... Directive ... a few new attributes*. * With a powerful backend. Model Just data, nothing more. Scope A context where the model is used. The center of the Angular Universe. Expressions Access to data and functions in the scope. ... 6
  • 7. Core concepts ... Filter Formatting and filtering. Controller Business logic, related to View layer. Service Reusable business logic, not related with View layer. Module Container for all this stuff. Find out more in the Conceptual Overview. 7
  • 9. ... in Classical Template Systems ... in Angular Templates Data Binding ... 9
  • 10. Two-way binding example Enter something: You've entered: <div data-ng-app> <label>Enter something:</label> <input type="text" data-ng-model="something" /> <p>You've entered: <strong>{{ something }}</strong></p> </div> — No JavaScript. At all. (supper-dummy) 01. 02. 03. 04. 05. 10
  • 11.
  • 12. Add contact: add All contacts: [] Filter by: Filtered: Two-way binding example (pro) (still so dummy) 12
  • 13. Add contact: add All contacts: [] Two-way binding example <div data-ng-controller="example2Controller"> <div> <label>Add contact:<br> <input type="text" data-ng-model="newContact" /> </label> <button data-ng-click="addContact(newContact)">add</button> <div data-ng-show="displayHelp"> <small>Format is wrong</small> </div> </div> <div> All contacts:<br><small>{{ contacts | json }}</small> </div> <!-- ... --> </div> (pro) (still so dummy) 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13. 14. 15. 13
  • 14. Add contact: add All contacts: [] Two-way binding example angular.module("angulardemo") .controller("example2Controller", function($scope) { $scope.contacts = []; $scope.addContact = function(newContact) { var contact = parseContact(newContact); if (!contact) { $scope.displayHelp = true; return; } $scope.contacts.push(contact); $scope.newContact = ""; $scope.displayHelp = false; }; // ... }); (pro) (still so dummy) 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13. 14. 15. 14
  • 15. Add contact: add All contacts: [] Two-way binding example angular.module("angulardemo") .controller("example2Controller", function($scope) { // ... $scope.$watch("newContact", function(newValue, oldValue) { if (!newValue.length) { $scope.displayHelp = false; } }); }); (pro) (still so dummy) 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 15
  • 16. Add contact: add Filter by: Filtered: Two-way binding example <input type="text" data-ng-model="query" /> <!-- ... --> <ul><li data-ng-repeat="contact in contacts | filter:query"> <small>{{ contact | contactInfo }}</small> </li></ul> angular.module("angulardemo") .controller("example2Controller", function($scope) {/* ... */}); .filter("contactInfo", function() { return function(input) { var name = input.firstName && input.lastName ? input.firstName + " " + input.lastName : null; return input.email ? (name ? name + " <" + input.email + ">" : input.email) : name; } }); (pro) (still so dummy) 01. 02. 03. 04. 05. 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 16
  • 18. UAH: USD: 0.00 EUR: 0.00 GBP: 0.00 Dependency injection example <div>UAH: <input type="text" data-ng-model="amount" /></div> <div>USD: {{ convert(amount, "UAH", "USD") | number:2 }}</div> <div>EUR: {{ convert(amount, "UAH", "EUR") | number:2 }}</div> <div>GBP: {{ convert(amount, "UAH", "GBP") | number:2 }}</div> angular.module("angulardemo") .controller("example3Controller", function($scope, ExchangeRateDummy) { $scope.convert = function(amount, from, to) { var rate = ExchangeRateDummy.getRate(from, to); return (parseFloat(amount) || 0) * (rate.rate || 0); } }); (dummy) 01. 02. 03. 04. 01. 02. 03. 04. 05. 06. 07. 18
  • 19. UAH: USD: 0.00 EUR: 0.00 GBP: 0.00 Dependency injection example angular.module("angulardemo") .factory("ExchangeRateDummy", function() { var rates = { "UAHUSD": { from: "UAH", to: "USD", rate: 0.06 }, "UAHEUR": { from: "UAH", to: "EUR", rate: 0.05 }, "UAHGBP": { from: "UAH", to: "GBP", rate: 0.04 } }; return { getRate: function(from, to) { return (from + to in rates) ? rates[from + to] : {}; } } }); (dummy) 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13. 19
  • 20. USD: AUD: 0.00 EUR: 0.00 GBP: 0.00 Dependency injection example <div>USD: <input type="text" data-ng-model="amount" /></div> <div>AUD: {{ converted.AUD | number:2 }}</div> <div>EUR: {{ converted.EUR | number:2 }}</div> <div>GBP: {{ converted.GBP | number:2 }}</div> (pro) 01. 02. 03. 04. 20
  • 21. USD: AUD: 0.00 EUR: 0.00 GBP: 0.00 Dependency injection example angular.module("angulardemo") .controller("example4Controller", function($scope, ExchangeRate) { $scope.converted = {"AUD": 0, "EUR": 0, "GBP": 0}; $scope.$watch("amount", function(amount) { angular.forEach($scope.converted, function(convertedValue, currency) { ExchangeRate.getRate("USD", currency).then(function(rate) { $scope.converted[currency] = (parseFloat(amount) || 0) * (rate || 0); }); }); }); }) .factory("ExchangeRate", ["$http", function($http) { var apiUrl = "http://apilayer.net/api/live?access_key=XXX"; return { getRate: function(from, to) { var requestUrl = apiUrl + "&source=" + from + "&currencies=" + to + "&callback=JSON_CALLBACK"; return $http.jsonp(requestUrl, {cache: true}).then(function(response) { return response.data.quotes[from + to]; }); } } }]); (pro) 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 21
  • 22.
  • 24. Cache manager directive <!-- app/templates/index.html --> <footer class="container-fluid"> ... <div data-cache-manager></div> ... </footer> 01. 02. 03. 04. 05. 06. 24
  • 25. Cache manager directive // app/js/modules/agile/directives/cache_manager.js angular.module("agile.directives") .directive("cacheManager", function($templateCache, Storage, Helper, TEMPLATES_URL) { return { scope: {}, controller: function ($scope) { $scope.clear = function() { $templateCache.removeAll(); Storage.clearAll(); Helper.setAlert("success", "Cache has been cleared.") } }, templateUrl: TEMPLATES_URL + "/cache-manager.directive.html" }; }); <!-- app/templates/cache-manager.directive.html --> <div class="cache-manager pull-right"> <button type="button" data-ng-click="clear()">Clear Cache</button> </div> 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13. 14. 15. 16. 01. 02. 03. 04. 25
  • 26. Enough code Just a few more things in a conclusion.
  • 27. Angular Projects •  https://builtwith.angularjs.org/ •  https://github.com/angular/angular.js/wiki/Projects-using-AngularJS
  • 28. Angular Projects •   Kontaktkarte — Contact book •   Hatjitsu — Distributed online scrum planning poker •   Semantic Body Browser — A tool for graphically exploring an organism •   Drugsearch — Android app for searching drugs in dragstores •   Mapa de personajes de la serie Isabel — The characters map in the “Isabel” series; ♥
  • 29. Angular is for: •  Web apps (single-page apps, mobile apps, browser extensions, etc.) •  Interactive websites (social networks, content management, admin panels) •  Interactive pages (checkout, statistics, graphics, reports, etc.) •  Fun
  • 30. •  Blogs •  News •  Affiliates •  Corporate websites •  E-Commerce •  Wikis Angular is not for: Of course it's not a rule.