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
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
An introduction to AngularJS
Quick introduction to AngularJS with some examples
Wojciech Sznapka
January 17, 2014
More Decks by Wojciech Sznapka
See All by Wojciech Sznapka
Getting started with Firebase in Angular
sznapka
1
110
PiHome – home automation done with Raspberry PI and Python
sznapka
0
450
Big data in the trenches
sznapka
1
440
PiHome – home automation done with Raspberry PI and Python
sznapka
0
410
Domain-Driven Design in PHP
sznapka
4
2.2k
Map-Reduce patterns
sznapka
3
320
Achieving wise architecture with Symfony2 @ SPUG#5
sznapka
2
270
Smart development environments
sznapka
2
1.6k
Automated tests - facts and myths
sznapka
1
1.8k
Other Decks in Programming
See All in Programming
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
400
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
680
「人を評価する AI」の設計と実装
ryoyanara
0
220
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
19k
Hono + Inertia + React で LP を構築した話
oukayuka
2
130
不幸な GC
chencmd
0
560
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
360
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
230
170k Jobs a Day on GKE: Scaling Mercari's CI Platform - and What's Next for AI-Native Development
junyaokabe
0
120
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
120
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.4k
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
230
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
3
520
Believing is Seeing
oripsolob
1
200
The Cost Of JavaScript in 2023
addyosmani
55
10k
Writing Fast Ruby
sferik
630
63k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
For a Future-Friendly Web
brad_frost
183
10k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Navigating Team Friction
lara
192
16k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
A Modern Web Designer's Workflow
chriscoyier
698
190k
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!