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
71
PiHome – home automation done with Raspberry PI and Python
sznapka
0
390
Big data in the trenches
sznapka
1
360
PiHome – home automation done with Raspberry PI and Python
sznapka
0
360
Domain-Driven Design in PHP
sznapka
4
2.1k
Map-Reduce patterns
sznapka
3
260
Achieving wise architecture with Symfony2 @ SPUG#5
sznapka
2
200
Smart development environments
sznapka
2
1.6k
Automated tests - facts and myths
sznapka
1
1.7k
Other Decks in Programming
See All in Programming
エラーって何種類あるの?
kajitack
5
310
Result型で“失敗”を型にするPHPコードの書き方
kajitack
4
390
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
160
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
980
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
410
WindowInsetsだってテストしたい
ryunen344
1
190
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
250
来たるべき 8.0 に備えて React 19 新機能と React Router 固有機能の取捨選択とすり合わせを考える
oukayuka
2
860
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
1
550
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
420
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
XP, Testing and ninja testing
m_seki
3
200
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
KATA
mclloyd
29
14k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
930
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
Building Adaptive Systems
keathley
43
2.6k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
790
Docker and Python
trallard
44
3.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
124
52k
The World Runs on Bad Software
bkeepers
PRO
69
11k
The Cost Of JavaScript in 2023
addyosmani
51
8.5k
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!