Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
15-437 AngularJS
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
ThierrySans
February 09, 2016
Programming
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
15-437 AngularJS
ThierrySans
February 09, 2016
More Decks by ThierrySans
See All by ThierrySans
CSCD27 Social Engineering
thierrysans
0
270
CSCD27 Web Security
thierrysans
0
470
CSCD27 Malicious Software
thierrysans
0
420
CSCD27 Protection
thierrysans
0
530
CSCD27 System Insecurity
thierrysans
0
460
CSCD27 Human Authentication
thierrysans
0
380
CSCD27 Network security
thierrysans
0
580
CSCD27 Network (in)security
thierrysans
0
570
CSCD27 Cryptography Protocols
thierrysans
0
750
Other Decks in Programming
See All in Programming
Verilogで学ぶCPU自作入門.pdf
uyuki234
8
4k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
190
速習iPhone Duo対応
yuukiw00w
2
960
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
setup-vp GitLab対応の裏側
naokihaba
0
150
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
440
iOSDC2026登壇資料.pdf
riofujimon
0
210
Workers Cache を知る
syumai
0
330
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5.4k
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
160
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
130
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Between Models and Reality
mayunak
4
480
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
The Cult of Friendly URLs
andyhume
79
7k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Statistics for Hackers
jakevdp
799
230k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
260
Six Lessons from altMBA
skipperchong
29
4.5k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Transcript
AngularJS Thierry Sans
Different approaches Binding between the DOM and the javascript code
jQuery-like Using DOM selectors AngularJS Using Angular directives
Application
ng-app directive <!DOCTYPE html> <html ng-app="simpsonsApp"> <head> <script src="bower_components/angular/angular.min.js"></script> <script
src="app/simpsonsapp.js"></script> </head> ... /index.html /app/simpsonsApp.json var app = angular.module('simpsonsApp',[]);
Controller
ng-controller directive <body ng-controller="simpsonsController as simpsons"> <header> <h1>{{simpsons.title}}</h1> <div ng-click="simpsons.foo()"></div>
</header> /index.html /app/simpsonsApp.json app.controller('simpsonsController',function(){ this.data = “Hello World!”; this.foo = function(){ this.data = “The Simpsons”; }; )};
ng-show (ng-hide) directive <header> <h1>The Simpsons</h1> <div id="admin_button" ng-click="simpsons.toggle()"></div> </header>
<div id="add_simpson_form_wrapper" ng-show="simpsons.show_form"> <form class="complex_form" id="add_simpson_form"> ... </form> </div> /index.html /app/simpsonsApp.json app.controller('simpsonsController',function(){ show_form = false; this.toggle = function(){ this.show_form = ! this.show_form; }; )};
ng-repeat directive <div class="entry" ng-repeat="img in simpsons.data"> <div class=“img_box"> <img
ng-src="{{img.img_url}}" alt=“{{img.firstname}}"/> </div> <div class=“firstname”> <a href=“{{img.w_url}}">{{img.firstname}}</a> </div> <div class="down_button vote_button">{{img.down_vote}}</div> <div class="up_button vote_button">{{img.up_vote}}</div> </div> /index.html /app/simpsonsApp.json this.data = [ {"firstname": “Bart", ...}, {"firstname": “Lisa”, ...} ];
Forms
ng-model and ng-submit directive /app/simpsonsApp.json app.controller('simpsonsController',function($scope){ this.character = {}; this.add_simpson
= function(){ this.character.up_vote=0; this.character.down_vote=0; this.data.push(this.character); this.character = {}; $scope.add_simpson_form.$setPristine(); };}); <form ng-submit=“simpsons.add_simpson()”> <div class="form_title">Add a Simpson</div> <input type="name" ng-model="simpsons.character.firstname"/> <input type="url" ng-model="simpsons.character.img_url"/> <input type="url" ng-model="simpsons.character.w_url"/> <input type="submit" class="btn" value="Add"/> </form> /index.html
Ajax
$ajax /app/simpsonsApp.json app.controller('simpsonsController',function($http){ this.data = []; var controller = this;
$http.get('api/simpsons.json') .success(function(data,status){ controller.data = data; }) .error(function(error,status){ }); });
Service (Model)
Routing