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
Powerful Applications with AngularJS
Search
Anna Filina
May 30, 2015
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Powerful Applications with AngularJS
Anna Filina
May 30, 2015
More Decks by Anna Filina
See All by Anna Filina
Surviving a Symfony Upgrade
afilina
1
200
Upgrading Legacy to the Latest PHP Version
afilina
1
230
Better Code Design in PHP
afilina
0
320
Semi-Automated Refactoring and Upgrades with Rector
afilina
0
220
Better Code Design in PHP
afilina
1
480
Better Code Design in PHP
afilina
0
650
Adding Tests to Untestable Legacy Code
afilina
0
430
Upgrading Legacy to the Latest PHP Version
afilina
0
440
Semi-Automated Refactoring and Upgrades with Rector
afilina
0
350
Other Decks in Programming
See All in Programming
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
230
今さら聞けない .NET CLI
htkym
0
200
テーブルをDELETEした
yuzneri
0
140
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
420
What's New in Android 2026
veronikapj
0
260
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.9k
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
380
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
5
1.8k
運用ダッシュボードの設計を誰も教えてくれないのだけどみなさんどうしてるんですか? - チームに監視するという文化を根付かせるための第一歩を踏みたい -
satoshi256kbyte
1
130
源内ハンズオン概要編
hideg
0
190
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
310
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
1
140
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
250
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Building AI with AI
inesmontani
PRO
1
1.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
3
440
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
A Soul's Torment
seathinner
6
3.4k
The Curse of the Amulet
leimatthew05
2
14k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Transcript
foolab.ca | @foolabca Powerful Applications with AngularJS CakeFest, New York
- May 30, 2015
Anna Filina • Developer • Problem solver • Coach •
Advisor 2
Objectives • More advanced front-end. • Maintainable code with fewer
bugs. • AngularJS site in 30 minutes. • Inspire to build great apps. 3
The problem with JS • Messy content updates. • HTML
tangled with JS. • Hard to keep everything in sync. 4
AngularJS • Automatic content updates. • HTML separated from JS
logic. • Everything automatically in sync. 5
Data flow 7 products selectedProduct
HTML <html ng-app> <head> <script src="angular.js"></script> <script src="app.js"></script> </head> <body>
<div ng-controller="ProductsCtrl"> </div> </body> </html> 8
Inside the DIV <div ng-controller="ProductsCtrl"> <div ng-repeat="item in products"> <img
ng-src="{{ item.image }}"> <p>{{ item.name }}</p> </div> </div> 9
Details <div ng-show="selectedProduct"> <h2>{{ selectedProduct.name }}</h2> </div> [...] <div ng-repeat="item
in products"> <a href="" ng-click="showDetails(item)"></a> </div> 10
Javascript function ProductsCtrl($scope) { $scope.products = [ { "id": "product-1",
"name": "Skyrim", "description": "Short product description.", "image": "http:...", "price": 19.99, "stock": 10 }]; $scope.showDetails = function(item) { $scope.selectedProduct = item; }; }; 11
Data flow 12 $scope.products $scope.showDetails $scope.selectedProduct <div ng-repeat="item in products">
<a ng-click="showDetails(item)"> <h2>{{ selectedProduct.name }}</h2>
Directives (ng-) 13 ng-show="selectedProduct" ng-class="{nostock: selectedProduct.stock == 0 }"
Data flow 15 maxPrice updateResults
HTML <input ng-model="minPrice" ng-change="updateResults()"> <div ng-repeat="item in products" ng-class="{dim: item.hidden
== true}"> 16
Javascript $scope.query = ''; $scope.minPrice = 1; $scope.maxPrice = 20;
$scope.updateResults = function() { for (var i = 0; i < $scope.products.length; i++) { var product = $scope.products[i]; product.hidden = true; [...] if (matchesQuery && matchesPrice) { product.hidden = false; } }; } 17
Directives (ng-) 18 <input ng-model="maxPrice" ng-change="updateResults()"> $scope.maxPrice $scope.updateResults = function()
{} <div ng-class="{dim: item.hidden == true}">
HTML <html ng-app="myApp"> [...] <script src="angular.js"></script> <script src="angular-resource.js"></script> 20
Javascript var app = angular.module('myApp', ['ngResource']); app.controller('ProductsCtrl', function($scope, $resource) {
var url = 'http://api.shop.dev/v1.0/products'; $resource(url).get({}, function(response) { $scope.products = response.data; }); }); 21
None
Services • Development: PHP, JS, etc. • Fix problems: bugs,
performance, etc. • Workshops: AngularJS, testing, Symfony, etc. • Advisor: testing strategy, architecture, etc. 25
@afilina afilina.com