Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
15-437 AngularJS
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ThierrySans
February 09, 2016
Programming
150
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
460
CSCD27 Malicious Software
thierrysans
0
410
CSCD27 Protection
thierrysans
0
520
CSCD27 System Insecurity
thierrysans
0
450
CSCD27 Human Authentication
thierrysans
0
370
CSCD27 Network security
thierrysans
0
580
CSCD27 Network (in)security
thierrysans
0
570
CSCD27 Cryptography Protocols
thierrysans
0
730
Other Decks in Programming
See All in Programming
Go 1.27 における memory allocation の高速化
andpad
0
360
ソフトウェアラスタライザ
fadis
1
750
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
2
740
Discordを用いたラボオートメーション関連情報収集の自動化
noguhiro2002
0
480
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.3k
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
610
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
330
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
180
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
8k
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.8k
仕様駆動開発の消費期限
watany
20
9.1k
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
270
Featured
See All Featured
Balancing Empowerment & Direction
lara
6
1.3k
BBQ
matthewcrist
89
10k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
390
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
260
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
430
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
The Invisible Side of Design
smashingmag
301
52k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
310
Automating Front-end Workflow
addyosmani
1369
210k
How GitHub (no longer) Works
holman
316
150k
My Coaching Mixtape
mlcsv
0
300
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