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
An introduction to AngularJS
Search
Wojciech Sznapka
January 17, 2014
Programming
0
240
An introduction to AngularJS
Quick introduction to AngularJS with some examples
Wojciech Sznapka
January 17, 2014
Tweet
Share
More Decks by Wojciech Sznapka
See All by Wojciech Sznapka
Getting started with Firebase in Angular
sznapka
1
77
PiHome – home automation done with Raspberry PI and Python
sznapka
0
400
Big data in the trenches
sznapka
1
370
PiHome – home automation done with Raspberry PI and Python
sznapka
0
370
Domain-Driven Design in PHP
sznapka
4
2.1k
Map-Reduce patterns
sznapka
3
270
Achieving wise architecture with Symfony2 @ SPUG#5
sznapka
2
210
Smart development environments
sznapka
2
1.6k
Automated tests - facts and myths
sznapka
1
1.7k
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
320
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
120
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
410
私の後悔をAWS DMSで解決した話
hiramax
4
190
Go言語での実装を通して学ぶLLMファインチューニングの仕組み / fukuokago22-llm-peft
monochromegane
0
110
testingを眺める
matumoto
1
130
More Approvers for Greater OSS and Japan Community
tkikuc
1
110
AIレビュアーをスケールさせるには / Scaling AI Reviewers
technuma
2
240
Trem on Rails - Prompt Engineering com Ruby
elainenaomi
1
100
開発チーム・開発組織の設計改善スキルの向上
masuda220
PRO
18
9.7k
Microsoft Orleans, Daprのアクターモデルを使い効率的に開発、デプロイを行うためのSekibanの試行錯誤 / Sekiban: Exploring Efficient Development and Deployment with Microsoft Orleans and Dapr Actor Models
tomohisa
0
230
UbieのAIパートナーを支えるコンテキストエンジニアリング実践
syucream
2
810
Featured
See All Featured
Thoughts on Productivity
jonyablonski
69
4.8k
Bash Introduction
62gerente
615
210k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
The World Runs on Bad Software
bkeepers
PRO
70
11k
How STYLIGHT went responsive
nonsquared
100
5.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Practical Orchestrator
shlominoach
190
11k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
Music & Morning Musume
bryan
46
6.8k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Transcript
AngularJS Frontend Development Chapter, 17.01.2014
A.K.A. HTML6 * Powerful JavaScript MVC framework supported by Google.
* Offers minimum boilerplate for great flexibility. * Highly adopted by market. * Operating through custom HTML markup.
Bootstrap // app.html <html ng-app="findash"> </html> // app.js var findash
= angular.module('findash', ['ngResource']); //ngResource is great REST client module findash.config(function($interpolateProvider){ $interpolateProvider.startSymbol('{[').endSymbol(']}'); // to not f*ck with Twig markup });
View layer Templating, loops, filters: <tbody> <tr ng-repeat="expenditure in expenditures">
<td>{[ expenditure.name ]}</td> <td>{[ expenditure.client ]}</td> <td>{[ expenditure.amount | currency:'zł ' ]}</td> <td>{[ expenditure.created_at | date:'yyyy-MM-dd' ]}</td> </tr> </tbody>
Controller Controller code with dependency injection: findash.controller('ExpenditureList', ['$scope', '$resource', 'expendituresService',
function($scope, $resource, expendituresService) { $scope.expenditures = expendituresService.expenditures; } ]); Controller binding in template: <div ng-controller="ExpenditureList"> <table width="100%"> <tbody> <tr ng-repeat="expenditure in expenditures">
Dependency Injection findash.factory('expendituresService', ['$resource', function($resource) { var $resource = $resource;
var inst = { expenditures: [], fetch: function () { return $resource('/expenditures.json').query(); }, }; inst.expenditures = inst.fetch(); return inst; } ]);
Model Two way data binding <div ng-controller="ExpenditureCreate"> <input type="text" ng-model="expenditure.name"
name="name" placeholder="* Nazwa" required /> <button class="small button" ng-click="create(expenditure)" </div> findash.controller('ExpenditureCreate', ['$scope', '$resource', '$filter', 'expendituresService', function($scope, $resource, $filter, expendituresService) { $scope.expenditure = {} $scope.create = function(expenditure) { alert(expenditure.name); // same as inserted in input above }; } ]);
MOAR * Unit tests! * Multiple templates * Routing *
Custom directives * Animations * 3rd party modules
Wojciech Sznapka Thanks!