SlideShare uma empresa Scribd logo
1 de 22
How to build Netvibes with AngularJS?




1

© OCTO 2012
“AngularJS is what HTML would
              have been had it been designed
                        for web applications.”

                                      Miško Hevery
                                    AngularJS creator, Google




2

© OCTO 2012
AngularJS WTF?
                           Key Features
                          My View Point
              I Wanna See Your Netvibes!
                   Experience Feedback
                              Questions

3

© OCTO 2012
AngularJS WTF?

               AngularJS is an open-source MVC JavaScript
              framework, which simplifies web development.



       HOW:
       • Two Way Data-binding
       • MVC
       • Testable
       • Supports all major browsers




4

© OCTO 2012
AngularJS WTF?
                            Key Features
                          My View Point
              I Wanna See Your Netvibes!
                   Experience Feedback
                              Questions

5

© OCTO 2012
Key Features
                           Views and
                           Templates



                                       Two-way Data
              Directives
                                         Binding


                           Testable


              Routing &
               Multiple                   Filters
               Views

                           REST and
                            Custom
                            Services




6

© OCTO 2012
Key Features: View and Templates
    4 new HTML attributes (for this exemple):
    •   ng-app used to flag an element which Angular should consider to be the
        root element of our application
    •   ng-controller used to invoke the corresponding controller
    •   ng-repeat used as a foreach
    •   ng-src similar to src prevents the browser from treating the angular {{
        expression }} markup literally, and initiating a request to invalid url




                                                              Demo: http://jsfiddle.net/eR2b2/4/



7

© OCTO 2012
Key Features: Two-way Data Binding

    In Angular, the view is a projection of the model through the HTML
    template. This means that whenever the model changes, Angular
    refreshes the appropriate binding points, which updates the view.




8

© OCTO 2012
Key Features: Two-way Data Binding
     2 new HTML attributes:
     •   ng-model is directive that tells Angular to do two-way data binding. It
         works together with input, select, textarea.
     •   {{variable}} a binding. The binding tells Angular that it should
         evaluate an expression and insert the result into the DOM in place of the
         binding.




                                                               Demo: http://jsfiddle.net/eR2b2/5/



9

© OCTO 2012
Key Features: Filters
     New tag:
     •   phone in phones|filter:query the filter function uses the
         query value to create a new array that contains only those records that
         match the query




                                                              Demo: http://jsfiddle.net/eR2b2/7/



10

© OCTO 2012
Key Features: REST and Custom Services
     New module:
     •   We used the module API to register a custom service using a factory
         function
     •   The $resource service makes it easy to create a RESTful client
     •   Phones list is now fetched from a WebService via our factory: Phone




                                                            Demo: http://jsfiddle.net/eR2b2/8/



11

© OCTO 2012
Key Features: Routing & Multiple Views
     New module:
     •   $routeProvider is the routing module
     •   If pattern /phones/:phoneId is matched, PhoneDetailCtrl controller is
         called and result is displayed in phones/show.html view




                                                          Demo: http://jsfiddle.net/eR2b2/12/



12

© OCTO 2012
Key Features: Directives
     New module:
     •   directive can be used to create custom HTML tags, add behavior and
         manipulate DOM attributes
     •   directive can be generic and used in several projects
     •   directive can be unlinked to an id or a class to have a behaviour
         undependent from design




                                                          Demo: http://jsfiddle.net/eR2b2/15/



13

© OCTO 2012
Key Features: Testable


                Built for creating testable JavaScript code.



     HOW:
     • Dependency Injection
     • MVC
     • Angular-seed scaffolds architecture with:
         • Unit Test
         • End-to-end user testing




14

© OCTO 2012
AngularJS WTF?
                            Key Features

                           My View Point
              I Wanna See Your Netvibes!
                   Experience Feedback
                              Questions

15

© OCTO 2012
My View Point

     FEATURES OUT OF THE BOX                      NICE ARCHITECTURE
          Two-Way Data-Binding                        MVC
          Localization (date, currency, number,       Everything is asynchronous
          pluralization)                              Can also be used on a part of an existing
          Deep linking                                application
          Form validation                             Client side
          Lightweight
          Works on mobile (ex: goodfil.ms)


     DEVELOPER FRIENDLY                           NEGATIVE POINTS
          Documentation                               Templates syntaxe (new HTML attributes)
          Testable (Jasmine)                          Think different (actions handle in views)
          Reusable components                         Learning curve is somewhat steep
          Chrome extension to debug
          Google Group very active




16

© OCTO 2012
AngularJS WTF?
                           Key Features
                          My View Point
              I wanna see your Netvibes!
                 Experience Feedback
                             Questions

17

© OCTO 2012
Exemple de slide image




18

© OCTO 2012
AngularJS WTF?
                           Key Features
                          My View Point
              I Wanna See Your Netvibes!

                   Experience Feedback
                             Questions

19

© OCTO 2012
Experience Feedback


              « If I've to do it again, I would not hesitate! »


     • 1 day to learn with official tutorial
     • Started developing the next day
     • Sometimes hard to think different
         • Spent lot of time looking for best practices
     • 8 days to get a working application
         • add 2 days for code I’ve reused from the POC




20

© OCTO 2012
AngularJS WTF?
                           Key Features
                          My View Point
              I Wanna See Your Netvibes!
                   Experience Feedback

                              Questions

21

© OCTO 2012
Questions?




                           Jonathan Meiss
                                  @JohnMeiss
                             jmeiss@octo.com




22

© OCTO 2012

Mais conteúdo relacionado

Mais procurados

Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete GuideSam Dias
 
Angular js
Angular jsAngular js
Angular jsMindtree
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework Camilo Lopes
 
Angular 2 interview questions and answers
Angular 2 interview questions and answersAngular 2 interview questions and answers
Angular 2 interview questions and answersAnil Singh
 
Angular 10 course_content
Angular 10 course_contentAngular 10 course_content
Angular 10 course_contentNAVEENSAGGAM1
 
Angular.js interview questions
Angular.js interview questionsAngular.js interview questions
Angular.js interview questionscodeandyou forums
 
Angularjs overview
Angularjs  overviewAngularjs  overview
Angularjs overviewVickyCmd
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSArmin Vieweg
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSAldo Pizzagalli
 
AngularJS Vs Angular: Understanding the Differences
AngularJS Vs Angular: Understanding the DifferencesAngularJS Vs Angular: Understanding the Differences
AngularJS Vs Angular: Understanding the DifferencesTechtic Solutions
 
AngularJS interview questions
AngularJS interview questionsAngularJS interview questions
AngularJS interview questionsUri Lukach
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction TutorialScott Lee
 
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaAngular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaEdureka!
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day WorkshopShyam Seshadri
 
AngularJS : Superheroic JavaScript MVW Framework
AngularJS : Superheroic JavaScript MVW FrameworkAngularJS : Superheroic JavaScript MVW Framework
AngularJS : Superheroic JavaScript MVW FrameworkEdureka!
 
Angular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationAngular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationEdureka!
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overviewJesse Warden
 
Angular js interview question answer for fresher
Angular js interview question answer for fresherAngular js interview question answer for fresher
Angular js interview question answer for fresherRavi Bhadauria
 

Mais procurados (20)

Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete Guide
 
Angular js
Angular jsAngular js
Angular js
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework
 
Angular 2 interview questions and answers
Angular 2 interview questions and answersAngular 2 interview questions and answers
Angular 2 interview questions and answers
 
Angular 10 course_content
Angular 10 course_contentAngular 10 course_content
Angular 10 course_content
 
Angular.js interview questions
Angular.js interview questionsAngular.js interview questions
Angular.js interview questions
 
Angularjs overview
Angularjs  overviewAngularjs  overview
Angularjs overview
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
 
AngularJS Vs Angular: Understanding the Differences
AngularJS Vs Angular: Understanding the DifferencesAngularJS Vs Angular: Understanding the Differences
AngularJS Vs Angular: Understanding the Differences
 
AngularJS interview questions
AngularJS interview questionsAngularJS interview questions
AngularJS interview questions
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
 
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaAngular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
 
AngularJS
AngularJSAngularJS
AngularJS
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
AngularJS : Superheroic JavaScript MVW Framework
AngularJS : Superheroic JavaScript MVW FrameworkAngularJS : Superheroic JavaScript MVW Framework
AngularJS : Superheroic JavaScript MVW Framework
 
Angular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationAngular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page Application
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
 
Angular js interview question answer for fresher
Angular js interview question answer for fresherAngular js interview question answer for fresher
Angular js interview question answer for fresher
 

Destaque

10 astuces pour améliorer les performances de son application AngularJS - ng...
10 astuces pour améliorer les performances de son application AngularJS - ng...10 astuces pour améliorer les performances de son application AngularJS - ng...
10 astuces pour améliorer les performances de son application AngularJS - ng...Jonathan Meiss
 
Petit déjeuner OCTO - Nouvelles Architectures Web Front-end et APIs
Petit déjeuner OCTO - Nouvelles Architectures Web Front-end et APIsPetit déjeuner OCTO - Nouvelles Architectures Web Front-end et APIs
Petit déjeuner OCTO - Nouvelles Architectures Web Front-end et APIsJonathan Meiss
 
How we built a job board in one week with JHipster
How we built a job board in one week with JHipsterHow we built a job board in one week with JHipster
How we built a job board in one week with JHipsterKile Niklawski
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016Matt Raible
 
Campo electrico problemas resueltos-gonzalo revelo pabon
Campo electrico   problemas resueltos-gonzalo revelo pabonCampo electrico   problemas resueltos-gonzalo revelo pabon
Campo electrico problemas resueltos-gonzalo revelo pabonGONZALO REVELO PABON . GORETTI
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

Destaque (6)

10 astuces pour améliorer les performances de son application AngularJS - ng...
10 astuces pour améliorer les performances de son application AngularJS - ng...10 astuces pour améliorer les performances de son application AngularJS - ng...
10 astuces pour améliorer les performances de son application AngularJS - ng...
 
Petit déjeuner OCTO - Nouvelles Architectures Web Front-end et APIs
Petit déjeuner OCTO - Nouvelles Architectures Web Front-end et APIsPetit déjeuner OCTO - Nouvelles Architectures Web Front-end et APIs
Petit déjeuner OCTO - Nouvelles Architectures Web Front-end et APIs
 
How we built a job board in one week with JHipster
How we built a job board in one week with JHipsterHow we built a job board in one week with JHipster
How we built a job board in one week with JHipster
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
 
Campo electrico problemas resueltos-gonzalo revelo pabon
Campo electrico   problemas resueltos-gonzalo revelo pabonCampo electrico   problemas resueltos-gonzalo revelo pabon
Campo electrico problemas resueltos-gonzalo revelo pabon
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Semelhante a OCTO BOF - How to build Netvibes with AngularJS

Angular js up & running
Angular js up & runningAngular js up & running
Angular js up & runningJunaid Baloch
 
What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?Albiorix Technology
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to conceptsAbhishek Sur
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - IntroductionSagar Acharya
 
AngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and DisadvantagesAngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and DisadvantagesWeblineIndia
 
AngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and DisadvantagesAngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and Disadvantageskarenmsmith0504
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJsAhmed Elharouny
 
JavaScript - Kristiansand PHP
JavaScript - Kristiansand PHPJavaScript - Kristiansand PHP
JavaScript - Kristiansand PHPholeedave
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesQamar Abbas
 
Building share point apps with angularjs
Building share point apps with angularjsBuilding share point apps with angularjs
Building share point apps with angularjsAhmed Elharouny
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) PresentationRaghubir Singh
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupGoutam Dey
 

Semelhante a OCTO BOF - How to build Netvibes with AngularJS (20)

Angular js up & running
Angular js up & runningAngular js up & running
Angular js up & running
 
Knockout js
Knockout jsKnockout js
Knockout js
 
What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
5 benefits of angular js
5 benefits of angular js5 benefits of angular js
5 benefits of angular js
 
Anjular js
Anjular jsAnjular js
Anjular js
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Itroducing Angular JS
Itroducing Angular JSItroducing Angular JS
Itroducing Angular JS
 
AngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and DisadvantagesAngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and Disadvantages
 
AngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and DisadvantagesAngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and Disadvantages
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
JavaScript - Kristiansand PHP
JavaScript - Kristiansand PHPJavaScript - Kristiansand PHP
JavaScript - Kristiansand PHP
 
AngularJS
AngularJS AngularJS
AngularJS
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
 
Building share point apps with angularjs
Building share point apps with angularjsBuilding share point apps with angularjs
Building share point apps with angularjs
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
Spa with angular
Spa with angularSpa with angular
Spa with angular
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
 
AngularJS
AngularJSAngularJS
AngularJS
 
Angular vs React : A Detailed Comparision
Angular vs React : A Detailed ComparisionAngular vs React : A Detailed Comparision
Angular vs React : A Detailed Comparision
 

OCTO BOF - How to build Netvibes with AngularJS

  • 1. How to build Netvibes with AngularJS? 1 © OCTO 2012
  • 2. “AngularJS is what HTML would have been had it been designed for web applications.” Miško Hevery AngularJS creator, Google 2 © OCTO 2012
  • 3. AngularJS WTF? Key Features My View Point I Wanna See Your Netvibes! Experience Feedback Questions 3 © OCTO 2012
  • 4. AngularJS WTF? AngularJS is an open-source MVC JavaScript framework, which simplifies web development. HOW: • Two Way Data-binding • MVC • Testable • Supports all major browsers 4 © OCTO 2012
  • 5. AngularJS WTF? Key Features My View Point I Wanna See Your Netvibes! Experience Feedback Questions 5 © OCTO 2012
  • 6. Key Features Views and Templates Two-way Data Directives Binding Testable Routing & Multiple Filters Views REST and Custom Services 6 © OCTO 2012
  • 7. Key Features: View and Templates 4 new HTML attributes (for this exemple): • ng-app used to flag an element which Angular should consider to be the root element of our application • ng-controller used to invoke the corresponding controller • ng-repeat used as a foreach • ng-src similar to src prevents the browser from treating the angular {{ expression }} markup literally, and initiating a request to invalid url Demo: http://jsfiddle.net/eR2b2/4/ 7 © OCTO 2012
  • 8. Key Features: Two-way Data Binding In Angular, the view is a projection of the model through the HTML template. This means that whenever the model changes, Angular refreshes the appropriate binding points, which updates the view. 8 © OCTO 2012
  • 9. Key Features: Two-way Data Binding 2 new HTML attributes: • ng-model is directive that tells Angular to do two-way data binding. It works together with input, select, textarea. • {{variable}} a binding. The binding tells Angular that it should evaluate an expression and insert the result into the DOM in place of the binding. Demo: http://jsfiddle.net/eR2b2/5/ 9 © OCTO 2012
  • 10. Key Features: Filters New tag: • phone in phones|filter:query the filter function uses the query value to create a new array that contains only those records that match the query Demo: http://jsfiddle.net/eR2b2/7/ 10 © OCTO 2012
  • 11. Key Features: REST and Custom Services New module: • We used the module API to register a custom service using a factory function • The $resource service makes it easy to create a RESTful client • Phones list is now fetched from a WebService via our factory: Phone Demo: http://jsfiddle.net/eR2b2/8/ 11 © OCTO 2012
  • 12. Key Features: Routing & Multiple Views New module: • $routeProvider is the routing module • If pattern /phones/:phoneId is matched, PhoneDetailCtrl controller is called and result is displayed in phones/show.html view Demo: http://jsfiddle.net/eR2b2/12/ 12 © OCTO 2012
  • 13. Key Features: Directives New module: • directive can be used to create custom HTML tags, add behavior and manipulate DOM attributes • directive can be generic and used in several projects • directive can be unlinked to an id or a class to have a behaviour undependent from design Demo: http://jsfiddle.net/eR2b2/15/ 13 © OCTO 2012
  • 14. Key Features: Testable Built for creating testable JavaScript code. HOW: • Dependency Injection • MVC • Angular-seed scaffolds architecture with: • Unit Test • End-to-end user testing 14 © OCTO 2012
  • 15. AngularJS WTF? Key Features My View Point I Wanna See Your Netvibes! Experience Feedback Questions 15 © OCTO 2012
  • 16. My View Point FEATURES OUT OF THE BOX NICE ARCHITECTURE Two-Way Data-Binding MVC Localization (date, currency, number, Everything is asynchronous pluralization) Can also be used on a part of an existing Deep linking application Form validation Client side Lightweight Works on mobile (ex: goodfil.ms) DEVELOPER FRIENDLY NEGATIVE POINTS Documentation Templates syntaxe (new HTML attributes) Testable (Jasmine) Think different (actions handle in views) Reusable components Learning curve is somewhat steep Chrome extension to debug Google Group very active 16 © OCTO 2012
  • 17. AngularJS WTF? Key Features My View Point I wanna see your Netvibes! Experience Feedback Questions 17 © OCTO 2012
  • 18. Exemple de slide image 18 © OCTO 2012
  • 19. AngularJS WTF? Key Features My View Point I Wanna See Your Netvibes! Experience Feedback Questions 19 © OCTO 2012
  • 20. Experience Feedback « If I've to do it again, I would not hesitate! » • 1 day to learn with official tutorial • Started developing the next day • Sometimes hard to think different • Spent lot of time looking for best practices • 8 days to get a working application • add 2 days for code I’ve reused from the POC 20 © OCTO 2012
  • 21. AngularJS WTF? Key Features My View Point I Wanna See Your Netvibes! Experience Feedback Questions 21 © OCTO 2012
  • 22. Questions? Jonathan Meiss @JohnMeiss jmeiss@octo.com 22 © OCTO 2012