AngularJS first steps

S
od Dinosaura k JavaScriptu




        Ladislav Gažo

       gazo@seges.sk
       @ladislavGazo
JavaScript.... whaaat?




2 | Internal use only
I need CLEVER JavaScript framework




                                                bottle for the trip

3 | Internal use only
A co to ten angulár umí?

      • Data binding
      • Controller
      • Plain JavaScript
      • Validation
      • Server communication
      • Directives
      • Injection
      • Testing

4 | Internal use only
<h2>BizMon</h2>
                        <div id="bizmonApp" ng-controller="BizmonCtrl">
                            <div class="navbar navbar-fixed-top">
                                <div class="navbar-inner">
                                    <div class="container">
                                        <a class="brand" href="#">Bizmon</a>
                                        <ul class="nav">
                                            <li ng-repeat="project in projects">
                                                <a ng-href="#/projects/
                        {{project.id}}">{{project.name}}</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="container-fluid">
                                <div class="row-fluid" ng-view></div>

                                <footer>
                                    <p>&copy; Seges 2012</p>
                                </footer>
                            </div>
                        </div>




5 | Internal use only
Curly brackets?




                          In HTML?


6 | Internal use only
function BizmonCtrl($scope, projectService) {
              $scope.projects = projectService.query();
           }
           BizmonCtrl.$inject = ["$scope", "projectService"];




7 | Internal use only
angular.module('bizmonApp.services', [ 'ngResource' ]).factory(
           'projectService', function($resource) {
           var service = $resource('rest/projects/:projectId', {}, {});
           return service;
       });




            mvn -o archetype:generate -DarchetypeGroupId=sk.seges.acris.archetype -DarchetypeArtifactId=acris-archetype-rest-server

             ( AcrIS - http://acris.googlecode.com )



8 | Internal use only
ng-click wohohooo




9 | Internal use only
<tr ng-repeat="issueState in prjScope.issueStates">
           <td ng-class="'operation-' + issueState.operation">
               <a ng-click="editIssue(issueState)">{{issueState.uuid}}</a>
           </td>
           <td>{{issueState.reason}}</td>
           <td>
               <span class="btn-group" ng-show="projectScopeViews[prjScope.id].edit">
                   <a class="btn btn-primary" ng-click="toggleOperation(issueState)">
                       <span ng-bind="issueState.operation"></span>
                   </a>
                   <a class="btn btn-danger" ng-click="deleteIssue(prjScope,
       issueState)">Delete</a>
               </span>
           </td>
       </tr>




10 | Internal use only
<input type="textarea" ng-model="activeIssueState.reason"
                        placeholder="optional reason why you are creating the issue"
                size="4"/>




11 | Internal use only
Neatness


12 | Internal use only
var inputNameDirective =         ['$interpolate',
                                             function($interpolate) {
                 return {
                     restrict: 'A',
                     scope: {
                         inputName: 'attribute',
                         ngModel: 'accessor'
                     },
                     require: ['ngModel','^?form'],
                     link: function (scope, element, attrs, ctrl) {
                         var ex = $interpolate(scope.inputName);
                         scope.nameTransformed = ex(scope.$parent);

                             var modelCtrl = ctrl[0];
                             modelCtrl.$name = scope.nameTransformed;

                             var formCtrl = ctrl[1] || nullFormCtrl;
                             formCtrl.$addControl(modelCtrl);
                         }
                };
               }];


          angular.module('bizmonApp.directives',[]).directive('inputName',
          inputNameDirective);



13 | Internal use only
14 | Internal use only
WORK with US




                         Thank you for your patience

                              gazo@seges.sk
                              @ladislavGazo

15 | Internal use only
Links

      • BizMon project - https://github.com/lgazo/bizmon
      • AcrIS – http://acris.googlecode.com
      • AngularJS – http://angularjs.org




16 | Internal use only
1 of 16

Recommended

ITexperience - AngularJS by
ITexperience - AngularJSITexperience - AngularJS
ITexperience - AngularJSMichal Maxian
745 views20 slides
Introducing jQuery by
Introducing jQueryIntroducing jQuery
Introducing jQueryWildan Maulana
1.1K views17 slides
AngulrJS Overview by
AngulrJS OverviewAngulrJS Overview
AngulrJS OverviewEyal Vardi
10.8K views17 slides
Handlebars by
HandlebarsHandlebars
HandlebarsSivasankaran Murugaiyan
3.4K views41 slides
Introduction to javascript templating using handlebars.js by
Introduction to javascript templating using handlebars.jsIntroduction to javascript templating using handlebars.js
Introduction to javascript templating using handlebars.jsMindfire Solutions
2.8K views17 slides
React.js触ってみた 吉澤和香奈 by
React.js触ってみた 吉澤和香奈React.js触ってみた 吉澤和香奈
React.js触ってみた 吉澤和香奈Wakana Yoshizawa
2.7K views15 slides

More Related Content

What's hot

Template syntax in Angular 2.0 by
Template syntax in Angular 2.0Template syntax in Angular 2.0
Template syntax in Angular 2.0Eyal Vardi
3.6K views26 slides
Angular 2 Architecture (Bucharest 26/10/2016) by
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Eyal Vardi
4.1K views43 slides
Using JavaScript in Drupal by
Using JavaScript in DrupalUsing JavaScript in Drupal
Using JavaScript in Drupalkatbailey
2.6K views15 slides
Contagion的Ruby/Rails投影片 by
Contagion的Ruby/Rails投影片Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片cfc
753 views49 slides
JQuery In Drupal by
JQuery In DrupalJQuery In Drupal
JQuery In Drupalkatbailey
3.8K views22 slides
A Short Introduction To jQuery by
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuerySudar Muthu
2.5K views21 slides

What's hot(20)

Template syntax in Angular 2.0 by Eyal Vardi
Template syntax in Angular 2.0Template syntax in Angular 2.0
Template syntax in Angular 2.0
Eyal Vardi3.6K views
Angular 2 Architecture (Bucharest 26/10/2016) by Eyal Vardi
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
Eyal Vardi4.1K views
Using JavaScript in Drupal by katbailey
Using JavaScript in DrupalUsing JavaScript in Drupal
Using JavaScript in Drupal
katbailey2.6K views
Contagion的Ruby/Rails投影片 by cfc
Contagion的Ruby/Rails投影片Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片
cfc753 views
JQuery In Drupal by katbailey
JQuery In DrupalJQuery In Drupal
JQuery In Drupal
katbailey3.8K views
A Short Introduction To jQuery by Sudar Muthu
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuery
Sudar Muthu2.5K views
Client-side MVC with Backbone.js by iloveigloo
Client-side MVC with Backbone.js Client-side MVC with Backbone.js
Client-side MVC with Backbone.js
iloveigloo28.2K views
Component lifecycle hooks in Angular 2.0 by Eyal Vardi
Component lifecycle hooks in Angular 2.0Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
Eyal Vardi3.4K views
JavaScript and jQuery Basics by Kaloyan Kosev
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery Basics
Kaloyan Kosev3.5K views
Angular js - 4developers 12 kwietnia 2013 by Marcin Wosinek
Angular js - 4developers 12 kwietnia 2013Angular js - 4developers 12 kwietnia 2013
Angular js - 4developers 12 kwietnia 2013
Marcin Wosinek2.1K views
jQuery Presentation by Rod Johnson
jQuery PresentationjQuery Presentation
jQuery Presentation
Rod Johnson4.7K views
JavaScript the Smart Way - Getting Started with jQuery by katbailey
JavaScript the Smart Way - Getting Started with jQueryJavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuery
katbailey2.2K views
JavaScript for Flex Devs by Aaronius
JavaScript for Flex DevsJavaScript for Flex Devs
JavaScript for Flex Devs
Aaronius9.2K views
Jquery for post a form by Rakesh Kumar
Jquery for post a formJquery for post a form
Jquery for post a form
Rakesh Kumar621 views

Similar to AngularJS first steps

Opencast Admin UI - Introduction to developing using AngularJS by
Opencast Admin UI - Introduction to developing using AngularJSOpencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJSbuttyx
556 views27 slides
Angular Performance: Then, Now and the Future. Todd Motto by
Angular Performance: Then, Now and the Future. Todd MottoAngular Performance: Then, Now and the Future. Todd Motto
Angular Performance: Then, Now and the Future. Todd MottoFuture Insights
17.5K views71 slides
Get AngularJS Started! by
Get AngularJS Started!Get AngularJS Started!
Get AngularJS Started!Dzmitry Ivashutsin
1K views37 slides
Basics of AngularJS by
Basics of AngularJSBasics of AngularJS
Basics of AngularJSFilip Janevski
460 views34 slides
Private slideshow by
Private slideshowPrivate slideshow
Private slideshowsblackman
878 views16 slides
Angular.js опыт использования, проблемы и решения by
Angular.js опыт использования, проблемы и решенияAngular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решенияOlga Lavrentieva
2.1K views15 slides

Similar to AngularJS first steps(20)

Opencast Admin UI - Introduction to developing using AngularJS by buttyx
Opencast Admin UI - Introduction to developing using AngularJSOpencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJS
buttyx556 views
Angular Performance: Then, Now and the Future. Todd Motto by Future Insights
Angular Performance: Then, Now and the Future. Todd MottoAngular Performance: Then, Now and the Future. Todd Motto
Angular Performance: Then, Now and the Future. Todd Motto
Future Insights17.5K views
Private slideshow by sblackman
Private slideshowPrivate slideshow
Private slideshow
sblackman878 views
Angular.js опыт использования, проблемы и решения by Olga Lavrentieva
Angular.js опыт использования, проблемы и решенияAngular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решения
Olga Lavrentieva2.1K views
How to Mess Up Your Angular UI Components by cagataycivici
How to Mess Up Your Angular UI ComponentsHow to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI Components
cagataycivici842 views
[Coscup 2012] JavascriptMVC by Alive Kuo
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
Alive Kuo1.3K views
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa... by FalafelSoftware
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
FalafelSoftware3.1K views
AngularJS Compile Process by Eyal Vardi
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile Process
Eyal Vardi11.2K views
Building Grails Plugins - Tips And Tricks by Mike Hugo
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
Mike Hugo7.3K views
gDayX 2013 - Advanced AngularJS - Nicolas Embleton by George Nguyen
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
George Nguyen1.4K views

More from seges

Spring Boot and Microservices by
Spring Boot and MicroservicesSpring Boot and Microservices
Spring Boot and Microservicesseges
2.3K views31 slides
Automated Tomcat Management by
Automated Tomcat ManagementAutomated Tomcat Management
Automated Tomcat Managementseges
1.4K views34 slides
Javist Being Cheftain by
Javist Being CheftainJavist Being Cheftain
Javist Being Cheftainseges
852 views23 slides
Multi-tenancy in Java by
Multi-tenancy in JavaMulti-tenancy in Java
Multi-tenancy in Javaseges
11.3K views26 slides
OSGi experiments by
OSGi experimentsOSGi experiments
OSGi experimentsseges
1.5K views14 slides
Internetová prítomnosť a content management by
Internetová prítomnosť a content managementInternetová prítomnosť a content management
Internetová prítomnosť a content managementseges
270 views13 slides

More from seges(8)

Spring Boot and Microservices by seges
Spring Boot and MicroservicesSpring Boot and Microservices
Spring Boot and Microservices
seges2.3K views
Automated Tomcat Management by seges
Automated Tomcat ManagementAutomated Tomcat Management
Automated Tomcat Management
seges1.4K views
Javist Being Cheftain by seges
Javist Being CheftainJavist Being Cheftain
Javist Being Cheftain
seges852 views
Multi-tenancy in Java by seges
Multi-tenancy in JavaMulti-tenancy in Java
Multi-tenancy in Java
seges11.3K views
OSGi experiments by seges
OSGi experimentsOSGi experiments
OSGi experiments
seges1.5K views
Internetová prítomnosť a content management by seges
Internetová prítomnosť a content managementInternetová prítomnosť a content management
Internetová prítomnosť a content management
seges270 views
GWT Workshop by seges
GWT WorkshopGWT Workshop
GWT Workshop
seges441 views
Ako sme zistili ze asi robime Scrum by seges
Ako sme zistili ze asi robime ScrumAko sme zistili ze asi robime Scrum
Ako sme zistili ze asi robime Scrum
seges488 views

AngularJS first steps

  • 1. od Dinosaura k JavaScriptu Ladislav Gažo gazo@seges.sk @ladislavGazo
  • 2. JavaScript.... whaaat? 2 | Internal use only
  • 3. I need CLEVER JavaScript framework bottle for the trip 3 | Internal use only
  • 4. A co to ten angulár umí? • Data binding • Controller • Plain JavaScript • Validation • Server communication • Directives • Injection • Testing 4 | Internal use only
  • 5. <h2>BizMon</h2> <div id="bizmonApp" ng-controller="BizmonCtrl"> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a class="brand" href="#">Bizmon</a> <ul class="nav"> <li ng-repeat="project in projects"> <a ng-href="#/projects/ {{project.id}}">{{project.name}}</a> </li> </ul> </div> </div> </div> <div class="container-fluid"> <div class="row-fluid" ng-view></div> <footer> <p>&copy; Seges 2012</p> </footer> </div> </div> 5 | Internal use only
  • 6. Curly brackets? In HTML? 6 | Internal use only
  • 7. function BizmonCtrl($scope, projectService) { $scope.projects = projectService.query(); } BizmonCtrl.$inject = ["$scope", "projectService"]; 7 | Internal use only
  • 8. angular.module('bizmonApp.services', [ 'ngResource' ]).factory( 'projectService', function($resource) { var service = $resource('rest/projects/:projectId', {}, {}); return service; }); mvn -o archetype:generate -DarchetypeGroupId=sk.seges.acris.archetype -DarchetypeArtifactId=acris-archetype-rest-server ( AcrIS - http://acris.googlecode.com ) 8 | Internal use only
  • 9. ng-click wohohooo 9 | Internal use only
  • 10. <tr ng-repeat="issueState in prjScope.issueStates"> <td ng-class="'operation-' + issueState.operation"> <a ng-click="editIssue(issueState)">{{issueState.uuid}}</a> </td> <td>{{issueState.reason}}</td> <td> <span class="btn-group" ng-show="projectScopeViews[prjScope.id].edit"> <a class="btn btn-primary" ng-click="toggleOperation(issueState)"> <span ng-bind="issueState.operation"></span> </a> <a class="btn btn-danger" ng-click="deleteIssue(prjScope, issueState)">Delete</a> </span> </td> </tr> 10 | Internal use only
  • 11. <input type="textarea" ng-model="activeIssueState.reason" placeholder="optional reason why you are creating the issue" size="4"/> 11 | Internal use only
  • 13. var inputNameDirective = ['$interpolate', function($interpolate) { return { restrict: 'A', scope: { inputName: 'attribute', ngModel: 'accessor' }, require: ['ngModel','^?form'], link: function (scope, element, attrs, ctrl) { var ex = $interpolate(scope.inputName); scope.nameTransformed = ex(scope.$parent); var modelCtrl = ctrl[0]; modelCtrl.$name = scope.nameTransformed; var formCtrl = ctrl[1] || nullFormCtrl; formCtrl.$addControl(modelCtrl); } }; }]; angular.module('bizmonApp.directives',[]).directive('inputName', inputNameDirective); 13 | Internal use only
  • 14. 14 | Internal use only
  • 15. WORK with US Thank you for your patience gazo@seges.sk @ladislavGazo 15 | Internal use only
  • 16. Links • BizMon project - https://github.com/lgazo/bizmon • AcrIS – http://acris.googlecode.com • AngularJS – http://angularjs.org 16 | Internal use only