SlideShare a Scribd company logo
1 of 12
Download to read offline
PyVo #26
Ladislav Prskavec
@abtris
http://blog.prskavec.net
Actual versions
• 1.0.6 - stable
• 1.1.4 - unstable (animations)
http://blog.angularjs.org/2012/07/angularjs-10-12-
roadmap.html
Basics
1. <!doctype html>
2. <html ng-app>
3. <head>
4. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
5. </head>
6. <body>
7. <div>
8. <label>Name:</label>
9. <input type="text" ng-model="yourName" placeholder="Enter a name here">
10. <hr>
11. <h1>Hello {{yourName}}!</h1>
12. </div>
13. </body>
14.</html>
http://jsfiddle.net/abtris/5wHdq/
Add Some Control
1. <!doctype html>
2. <html ng-app>
3. <head>
4. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
5. <script src="todo.js"></script>
6. <link rel="stylesheet" href="todo.css">
7. </head>
8. <body>
9. <h2>Todo</h2>
10. <div ng-controller="TodoCtrl">
11. <span>{{remaining()}} of {{todos.length}} remaining</span>
12. [ <a href="" ng-click="archive()">archive</a> ]
13. <ul class="unstyled">
14. <li ng-repeat="todo in todos">
15. <input type="checkbox" ng-model="todo.done">
16. <span class="done-{{todo.done}}">{{todo.text}}</span>
17. </li>
18. </ul>
19. <form ng-submit="addTodo()">
20. <input type="text" ng-model="todoText" size="30"
21. placeholder="add new todo here">
22. <input class="btn-primary" type="submit" value="add">
23. </form>
24. </div>
25. </body>
26. </html>
Add Some Control
1. function TodoCtrl($scope) {
2. $scope.todos = [
3. {text:'learn angular', done:true},
4. {text:'build an angular app', done:false}];
5.  
6. $scope.addTodo = function() {
7. $scope.todos.push({text:$scope.todoText, done:false});
8. $scope.todoText = '';
9. };
10.  
11. $scope.remaining = function() {
12. var count = 0;
13. angular.forEach($scope.todos, function(todo) {
14. count += todo.done ? 0 : 1;
15. });
16. return count;
17. };
18.  
19. $scope.archive = function() {
20. var oldTodos = $scope.todos;
21. $scope.todos = [];
22. angular.forEach(oldTodos, function(todo) {
23. if (!todo.done) $scope.todos.push(todo);
24. });
25. };
26. }
1. .done-true {
2. text-decoration: line-through;
3. color: grey;
4. }
http://jsfiddle.net/abtris/jqAKw/
Directives libraries
• https://github.com/lmc-eu/ngx-library
• http://angular-ui.github.io/bootstrap/
• http://angular-ui.github.io/ng-grid/
• http://angular-ui.github.io/
Backend wiring
• https://github.com/mgonto/restangular
• Ruby on Rails
• CakePHP for PHP
• Play1 & 2 for Java & scala
• Restify and Express for NodeJS
http://plnkr.co/edit/Sh669ScCQRyD513bzsBx
https://github.com/cheekybastard/django-angularjs-rest
Batarang
https://github.com/angular/angularjs-batarang
Show at http://todo.dev/
npm install -g yo grunt-cli bower
npm install generator-angular generator-karma
yo angular
bower install angular-ui
grunt test
grunt server
grunt
Karma
• Spectacular Test Runner for JavaScript
• http://karma-runner.github.io/0.8/index.html
• https://github.com/yeoman/generator-karma
ng-animate
• http://yearofmoo-articles.github.io/
angularjs-animation-article/app/#/ng-repeat
• http://www.yearofmoo.com/2013/04/
animation-in-angularjs.html
• https://www.youtube.com/watch?
feature=player_embedded&v=cF_JsA9KsD
M
Books
• AngularJS - Brad Green, Shyam Seshadri
• Developing an AngularJS Edge -
Christopher Hiller
• Instant AngularJS Starter - Dan Menard

More Related Content

What's hot

jQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web PerformancejQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web Performance
dmethvin
 
OSCON 2014: OpenUI5 - The New Responsive Web UI Library
OSCON 2014: OpenUI5 - The New Responsive Web UI LibraryOSCON 2014: OpenUI5 - The New Responsive Web UI Library
OSCON 2014: OpenUI5 - The New Responsive Web UI Library
Andreas Kunz
 
Unobtrusive javascript
Unobtrusive javascriptUnobtrusive javascript
Unobtrusive javascript
Lee Jordan
 

What's hot (20)

Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaks
 
jQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web PerformancejQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web Performance
 
Vuejs for Angular developers
Vuejs for Angular developersVuejs for Angular developers
Vuejs for Angular developers
 
AngularJS performance & production tips
AngularJS performance & production tipsAngularJS performance & production tips
AngularJS performance & production tips
 
High Performance Snippets
High Performance SnippetsHigh Performance Snippets
High Performance Snippets
 
The Future of CSS with Web Components
The Future of CSS with Web ComponentsThe Future of CSS with Web Components
The Future of CSS with Web Components
 
Desenvolvimento web com jQuery Mobile
Desenvolvimento web com jQuery MobileDesenvolvimento web com jQuery Mobile
Desenvolvimento web com jQuery Mobile
 
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
 
JavaFX meetup
JavaFX meetupJavaFX meetup
JavaFX meetup
 
The Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.js
 
AngularJs advanced Topics
AngularJs advanced TopicsAngularJs advanced Topics
AngularJs advanced Topics
 
Rapid Testing, Rapid Development
Rapid Testing, Rapid DevelopmentRapid Testing, Rapid Development
Rapid Testing, Rapid Development
 
Angular js slides
Angular js slidesAngular js slides
Angular js slides
 
Design+Performance Velocity 2015
Design+Performance Velocity 2015Design+Performance Velocity 2015
Design+Performance Velocity 2015
 
Calender
CalenderCalender
Calender
 
Require js
Require jsRequire js
Require js
 
Introduction à AngularJS
Introduction à AngularJSIntroduction à AngularJS
Introduction à AngularJS
 
OSCON 2014: OpenUI5 - The New Responsive Web UI Library
OSCON 2014: OpenUI5 - The New Responsive Web UI LibraryOSCON 2014: OpenUI5 - The New Responsive Web UI Library
OSCON 2014: OpenUI5 - The New Responsive Web UI Library
 
Unobtrusive javascript
Unobtrusive javascriptUnobtrusive javascript
Unobtrusive javascript
 
orcreatehappyusers
orcreatehappyusersorcreatehappyusers
orcreatehappyusers
 

Viewers also liked (7)

PragueJS meetups 30th anniversary
PragueJS meetups 30th anniversaryPragueJS meetups 30th anniversary
PragueJS meetups 30th anniversary
 
How to easy deploy app into any cloud
How to easy deploy app into any cloudHow to easy deploy app into any cloud
How to easy deploy app into any cloud
 
CI and CD
CI and CDCI and CD
CI and CD
 
Docker - modern platform for developement and operations
Docker - modern platform for developement and operationsDocker - modern platform for developement and operations
Docker - modern platform for developement and operations
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
 
Datascript: Serverless Architetecture
Datascript: Serverless ArchitetectureDatascript: Serverless Architetecture
Datascript: Serverless Architetecture
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
 

Similar to AngularJS at PyVo

Similar to AngularJS at PyVo (20)

Angular js
Angular jsAngular js
Angular js
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)
 
JavaScript Perfomance
JavaScript PerfomanceJavaScript Perfomance
JavaScript Perfomance
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
 
Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)
 
CSS framework By Palash
CSS framework By PalashCSS framework By Palash
CSS framework By Palash
 
AngularJS interview questions
AngularJS interview questionsAngularJS interview questions
AngularJS interview questions
 
Course CodeSchool - Shaping up with Angular.js
Course CodeSchool - Shaping up with Angular.jsCourse CodeSchool - Shaping up with Angular.js
Course CodeSchool - Shaping up with Angular.js
 
Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!
 
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
 
Html5 & less css
Html5 & less cssHtml5 & less css
Html5 & less css
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
Taking your Web App for a walk
Taking your Web App for a walkTaking your Web App for a walk
Taking your Web App for a walk
 
Enough with the javas cript already! de Nicholas Zakas
Enough with the javas cript already! de Nicholas ZakasEnough with the javas cript already! de Nicholas Zakas
Enough with the javas cript already! de Nicholas Zakas
 
AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014
 
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
AngularJs Superheroic JavaScript MVW Framework Services by Miracle StudiosAngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
 
A High-Performance Solution To Microservices UI Composition
A High-Performance Solution To Microservices UI CompositionA High-Performance Solution To Microservices UI Composition
A High-Performance Solution To Microservices UI Composition
 
Upload[1]
Upload[1]Upload[1]
Upload[1]
 
crtical points for customizing Joomla templates
crtical points for customizing Joomla templatescrtical points for customizing Joomla templates
crtical points for customizing Joomla templates
 
243329387 angular-docs
243329387 angular-docs243329387 angular-docs
243329387 angular-docs
 

More from Ladislav Prskavec

Javascript Continues Integration in Jenkins with AngularJS
Javascript Continues Integration in Jenkins with AngularJSJavascript Continues Integration in Jenkins with AngularJS
Javascript Continues Integration in Jenkins with AngularJS
Ladislav Prskavec
 

More from Ladislav Prskavec (20)

SRE in Apiary
SRE in ApiarySRE in Apiary
SRE in Apiary
 
Modern Web Architecture<br>based on JS, API and Markup
Modern Web Architecture<br>based on JS, API and MarkupModern Web Architecture<br>based on JS, API and Markup
Modern Web Architecture<br>based on JS, API and Markup
 
How you can kill Wordpress!
How you can kill Wordpress!How you can kill Wordpress!
How you can kill Wordpress!
 
SRE in Startup
SRE in StartupSRE in Startup
SRE in Startup
 
CI and CD
CI and CDCI and CD
CI and CD
 
AWS Elastic Container Service
AWS Elastic Container ServiceAWS Elastic Container Service
AWS Elastic Container Service
 
Comparison nodejs frameworks using Polls API
Comparison nodejs frameworks using Polls APIComparison nodejs frameworks using Polls API
Comparison nodejs frameworks using Polls API
 
Docker Elastic Beanstalk
Docker Elastic BeanstalkDocker Elastic Beanstalk
Docker Elastic Beanstalk
 
Docker včera, dnes a zítra
Docker včera, dnes a zítraDocker včera, dnes a zítra
Docker včera, dnes a zítra
 
Tessel is a microcontroller that runs JavaScript.
Tessel is a microcontroller that runs JavaScript.Tessel is a microcontroller that runs JavaScript.
Tessel is a microcontroller that runs JavaScript.
 
Docker.io
Docker.ioDocker.io
Docker.io
 
Docker.io
Docker.ioDocker.io
Docker.io
 
AngularJS
AngularJSAngularJS
AngularJS
 
Firebase and AngularJS
Firebase and AngularJSFirebase and AngularJS
Firebase and AngularJS
 
Tvorba javascriptové aplikace v AngularJS pomocí Apiary.io
Tvorba javascriptové aplikace v AngularJS pomocí Apiary.ioTvorba javascriptové aplikace v AngularJS pomocí Apiary.io
Tvorba javascriptové aplikace v AngularJS pomocí Apiary.io
 
Postavte zeď mezi svoje vývojáře
Postavte zeď mezi svoje vývojářePostavte zeď mezi svoje vývojáře
Postavte zeď mezi svoje vývojáře
 
Grunt.js
Grunt.jsGrunt.js
Grunt.js
 
Javascript Continues Integration in Jenkins with AngularJS
Javascript Continues Integration in Jenkins with AngularJSJavascript Continues Integration in Jenkins with AngularJS
Javascript Continues Integration in Jenkins with AngularJS
 
Deployment prakticky
Deployment praktickyDeployment prakticky
Deployment prakticky
 
Barcamp2010
Barcamp2010Barcamp2010
Barcamp2010
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

AngularJS at PyVo

  • 2. Actual versions • 1.0.6 - stable • 1.1.4 - unstable (animations) http://blog.angularjs.org/2012/07/angularjs-10-12- roadmap.html
  • 3. Basics 1. <!doctype html> 2. <html ng-app> 3. <head> 4. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script> 5. </head> 6. <body> 7. <div> 8. <label>Name:</label> 9. <input type="text" ng-model="yourName" placeholder="Enter a name here"> 10. <hr> 11. <h1>Hello {{yourName}}!</h1> 12. </div> 13. </body> 14.</html> http://jsfiddle.net/abtris/5wHdq/
  • 4. Add Some Control 1. <!doctype html> 2. <html ng-app> 3. <head> 4. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script> 5. <script src="todo.js"></script> 6. <link rel="stylesheet" href="todo.css"> 7. </head> 8. <body> 9. <h2>Todo</h2> 10. <div ng-controller="TodoCtrl"> 11. <span>{{remaining()}} of {{todos.length}} remaining</span> 12. [ <a href="" ng-click="archive()">archive</a> ] 13. <ul class="unstyled"> 14. <li ng-repeat="todo in todos"> 15. <input type="checkbox" ng-model="todo.done"> 16. <span class="done-{{todo.done}}">{{todo.text}}</span> 17. </li> 18. </ul> 19. <form ng-submit="addTodo()"> 20. <input type="text" ng-model="todoText" size="30" 21. placeholder="add new todo here"> 22. <input class="btn-primary" type="submit" value="add"> 23. </form> 24. </div> 25. </body> 26. </html>
  • 5. Add Some Control 1. function TodoCtrl($scope) { 2. $scope.todos = [ 3. {text:'learn angular', done:true}, 4. {text:'build an angular app', done:false}]; 5.   6. $scope.addTodo = function() { 7. $scope.todos.push({text:$scope.todoText, done:false}); 8. $scope.todoText = ''; 9. }; 10.   11. $scope.remaining = function() { 12. var count = 0; 13. angular.forEach($scope.todos, function(todo) { 14. count += todo.done ? 0 : 1; 15. }); 16. return count; 17. }; 18.   19. $scope.archive = function() { 20. var oldTodos = $scope.todos; 21. $scope.todos = []; 22. angular.forEach(oldTodos, function(todo) { 23. if (!todo.done) $scope.todos.push(todo); 24. }); 25. }; 26. } 1. .done-true { 2. text-decoration: line-through; 3. color: grey; 4. } http://jsfiddle.net/abtris/jqAKw/
  • 6. Directives libraries • https://github.com/lmc-eu/ngx-library • http://angular-ui.github.io/bootstrap/ • http://angular-ui.github.io/ng-grid/ • http://angular-ui.github.io/
  • 7. Backend wiring • https://github.com/mgonto/restangular • Ruby on Rails • CakePHP for PHP • Play1 & 2 for Java & scala • Restify and Express for NodeJS http://plnkr.co/edit/Sh669ScCQRyD513bzsBx https://github.com/cheekybastard/django-angularjs-rest
  • 9. npm install -g yo grunt-cli bower npm install generator-angular generator-karma yo angular bower install angular-ui grunt test grunt server grunt
  • 10. Karma • Spectacular Test Runner for JavaScript • http://karma-runner.github.io/0.8/index.html • https://github.com/yeoman/generator-karma
  • 12. Books • AngularJS - Brad Green, Shyam Seshadri • Developing an AngularJS Edge - Christopher Hiller • Instant AngularJS Starter - Dan Menard