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
48
PiHome – home automation done with Raspberry PI and Python
sznapka
0
330
Big data in the trenches
sznapka
1
250
PiHome – home automation done with Raspberry PI and Python
sznapka
0
330
Domain-Driven Design in PHP
sznapka
4
2k
Map-Reduce patterns
sznapka
3
230
Achieving wise architecture with Symfony2 @ SPUG#5
sznapka
2
160
Smart development environments
sznapka
2
1.6k
Automated tests - facts and myths
sznapka
1
1.6k
Other Decks in Programming
See All in Programming
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
360
Milestoner
bkuhlmann
1
410
雑に思考を整理する技術と効能
konifar
58
29k
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
730
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
260
検証も兼ねて個人開発でHonoとかと向き合った話
hanetsuki
0
810
Goのエラースタックトレースの歴史と今後
sonatard
7
1.2k
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
290
Rethinking UI building strategies @ SFI 2024
letelete
0
270
新宿ダンジョンを可視化してみた
satoshi7190
2
240
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
1.1k
Hanami and htmx
bkuhlmann
0
210
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
60
14k
10 Git Anti Patterns You Should be Aware of
lemiorhan
648
58k
Automating Front-end Workflow
addyosmani
1356
200k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
Practical Orchestrator
shlominoach
182
9.7k
Happy Clients
brianwarren
92
6.4k
Docker and Python
trallard
34
2.7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
659
120k
How STYLIGHT went responsive
nonsquared
92
4.8k
Product Roadmaps are Hard
iamctodd
44
9.7k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
[RailsConf 2023] Rails as a piece of cake
palkan
23
3.9k
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!