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
230
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
60
PiHome – home automation done with Raspberry PI and Python
sznapka
0
370
Big data in the trenches
sznapka
1
310
PiHome – home automation done with Raspberry PI and Python
sznapka
0
350
Domain-Driven Design in PHP
sznapka
4
2k
Map-Reduce patterns
sznapka
3
240
Achieving wise architecture with Symfony2 @ SPUG#5
sznapka
2
170
Smart development environments
sznapka
2
1.6k
Automated tests - facts and myths
sznapka
1
1.6k
Other Decks in Programming
See All in Programming
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
3
370
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
350
return文におけるstd::moveについて
onihusube
1
1.1k
快速入門可觀測性
blueswen
0
350
CSC305 Lecture 26
javiergs
PRO
0
140
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
180
ドメインイベント増えすぎ問題
h0r15h0
2
300
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
270
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
2
670
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
130
Featured
See All Featured
RailsConf 2023
tenderlove
29
940
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
How GitHub (no longer) Works
holman
311
140k
Documentation Writing (for coders)
carmenintech
66
4.5k
How STYLIGHT went responsive
nonsquared
95
5.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
How to Ace a Technical Interview
jacobian
276
23k
Producing Creativity
orderedlist
PRO
341
39k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Raft: Consensus for Rubyists
vanstee
137
6.7k
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!