SlideShare a Scribd company logo
Grown-up JavaScript.
       with AngularJS

              Mykhailo Kotsur
              @sotomajor_ua
We will talk about

• Different ways to build a web-app
• Why in Javascript?
• AngularJS: things that make it rock
• Samples
• Code talks
Multi page application
Grown-up javascript with AngularJS
... Downloading page
... Downloading page

... Rendering page
... Downloading page

... Rendering page       ... Loading external resources
... Downloading page

... Rendering page       ... Loading external resources

               ... Executing scripts
We want:
We want:

Smooth user experience
We want:

Smooth user experience
  Unload our servers
Single page application
http://www.flickr.com/photos/60988113@N06/5996111491/sizes/z/in/photostream/




    http://www.lurvely.com/photo/491666425/Thin_tree_at_Lagoinha_Beach/
Thick server
Thick server


- Grab data
                    - Talk to server
- Business stuff
                    - Prepare HTML
- Prepare HTML
Thick server


- Grab data
                    - Talk to server
- Business stuff
                    - Prepare HTML
- Prepare HTML
We want
We want

Smooth experience!
We want
              Also
                 for
                     form
Smooth experience!        s!
We want
              Also
                 for
                     form
Smooth experience!        s!

  Unload servers!
We want
              Also
                 for
                     form
Smooth experience!        s!

  Unload servers!

Simplify development!
We want
              Also
                 for
                     form
Smooth experience!        s!

  Unload servers!

Simplify development!

Make server reusable!
Many clients - one
     server
Thin server



- Grab data           - Talk to server
- Business stuff      - Prepare view
Thin server

                   ?
- Grab data            - Talk to server
- Business stuff       - Prepare view
State
                                                 Transfer
                                                 REpresentational




http://www.flickr.com/photos/film_images/5687432148/
Verbs

POST
 GET
 PUT
DELETE
Verbs

POST     CREATE
 GET      READ
 PUT     UPDATE
DELETE   DELETE
Nouns
 people
Nouns
      people


Content types
      text/xml
     text/html
  application/json
Responses

• 200 - OK
• 201 - Created
• 204 - No content
• 404 - Not found
• ... many more
“Sentences”
GET me /people in format of application/json
“Sentences”
GET me /people in format of application/json

200! Here is your application/json
“Sentences”
GET me /people in format of application/json

200! Here is your application/json
[
  {id: 1, name: “Mike”},
  {id: 2, name: “Tom”}
]
“Sentences”
POST to /people in format of application/json

{name: “Jason”}
“Sentences”
POST to /people in format of application/json

{name: “Jason”}



200! Here is your application/json

{id: 3, name: “Jason”}
Our achievements:
• Happy users
• Less hardware
• Fair responsibility separation
• To be used by many clients
Our achievements:
• Happy users
• Less hardware
• Fair responsibility separation
• To be used by many clients
Any drawbacks?
Grown-up javascript with AngularJS
Grown-up javascript with AngularJS
Grown-up javascript with AngularJS
Grown-up javascript with AngularJS
http://www.flickr.com/photos/chalkbass/2334850242/sizes/z/in/photostream/
                                                                           SEO
What now?

• Data binding
• Routing
• Template engine
• Tests
Grown-up javascript with AngularJS
Grown-up javascript with AngularJS
2.5 years in development
2.5 years in development
Version 1.0 few weeks ago
2.5 years in development
Version 1.0 few weeks ago
Used in Google’s production projects
2.5 years in development
Version 1.0 few weeks ago
Used in Google’s production projects
3 people of core team + hundreds of community
2.5 years in development
Version 1.0 few weeks ago
Used in Google’s production projects
3 people of core team + hundreds of community
Makes web development fun again!
Grown-up javascript with AngularJS
Easy data binding
Easy data binding
Declarative approach
Easy data binding
Declarative approach
Routing and templating
Easy data binding
Declarative approach
Routing and templating
DI and TDD as a design base (15000+ tests)
Easy data binding
Easy data binding
   <h1>Hello, <span id="namePlaceholder"></span></h1>
    <input id="name" type="text">

    <script type="text/javascript">
        $(
            $('#name').keydown(function(e) {
                $('#namePlaceholder').html(e.target.value);
            })
        );
    </script>
<h1>Hello, {{name}}</h1>
<input type="text" ng-model="name">
Declarative approach
<div id="base"></div>

<script type="text/javascript">
  $(
      $([['Ciao', '‫' ,'שלום‬Привіт']]).each( function(k,v) {
          $('#base').append($('<h1>Hello, ' + v + '</h1>'));
      })
  );
</script>
<h1 ng-repeat="n in ['Ciao', '‫' ,'שלום‬Привіт']">
   Hello, {{n}}
</h1>
Routing and templating


   http://example.com/#!/register
???
$routeProvider.when(
  '/example',
  {templateUrl: './js/templates/example.html'}
);
Grown-up javascript with AngularJS
???
var SomeCtrl = function($scope, $element, $location) {
...
}
it('should just work', inject(function($controller) {
     var location = {path: function() {return '/';}}
     $controller(
        TabsCtrl,
        {$scope: scope, $element: base, $location: location}
     );

    expect(something).toBeTruthy();
}));
Grown-up javascript with AngularJS
$httpBackend.whenGET('http://api.com').respond({...});
$httpBackend.whenGET(/.*/).passThrough();
Grown-up javascript with AngularJS
Grown-up javascript with AngularJS
Production examples
Grown-up javascript with AngularJS
Grown-up javascript with AngularJS
Grown-up javascript with AngularJS
Grown-up javascript with AngularJS
Hello world example
 If you read this presentation on your own, checkout the
example from: http://github.com/mkotsur/flatometer and walk thru all
                 steps with http://bit.ly/N2MyVU
                 and read commit messages...
Questions?
                       http://mkotsur.github.com/gitoscop/




http://angularjs.org                        http://github.com/mkotsur/flatometer

More Related Content

PPTX
Ui dev@naukri-2011
PDF
How to Prepare a WordPress Theme for Public Release
PDF
WordPress Theme Structure
PPTX
Challenges going mobile
PDF
Turning Landing Pages into Lead Gen Gold
PPTX
Digital marketing class ppt
PDF
Reviewing RESTful Web Apps
PDF
WordPress Theme Development Basics
Ui dev@naukri-2011
How to Prepare a WordPress Theme for Public Release
WordPress Theme Structure
Challenges going mobile
Turning Landing Pages into Lead Gen Gold
Digital marketing class ppt
Reviewing RESTful Web Apps
WordPress Theme Development Basics

What's hot (19)

KEY
What is WordPress and Why Is Everyone Talking About it
PDF
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
PPTX
Moving from Wordpress.com to Wordpress.org - Wordcamp Toronto 2011
PPTX
WordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
PPT
WordCamp Boston 2012 - Creating Content With Shortcodes
PDF
电子商务网站前端开放实战
KEY
D2-超级旺铺
PPT
Please dont touch-3.6-jsday
PPTX
Custom WordPress theme development
PDF
Html css crash course may 11th, atlanta
PPTX
SEO for WordPress in 10 Simple Steps
PPTX
Wordpress theme submission requirement for Themeforest
PPTX
Simple WordPress SEO
PPTX
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
PPTX
The WordPress REST API as a Springboard for Website Greatness
PPT
Amazon.com's Web Services Opportunity
PPTX
From PSD to WordPress Theme: Bringing designs to life
PPTX
Basic web page designing
PDF
New Web Typography
What is WordPress and Why Is Everyone Talking About it
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Moving from Wordpress.com to Wordpress.org - Wordcamp Toronto 2011
WordCamp Kent 2019 - WP 101: Local Development - Themes and Plugins
WordCamp Boston 2012 - Creating Content With Shortcodes
电子商务网站前端开放实战
D2-超级旺铺
Please dont touch-3.6-jsday
Custom WordPress theme development
Html css crash course may 11th, atlanta
SEO for WordPress in 10 Simple Steps
Wordpress theme submission requirement for Themeforest
Simple WordPress SEO
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
The WordPress REST API as a Springboard for Website Greatness
Amazon.com's Web Services Opportunity
From PSD to WordPress Theme: Bringing designs to life
Basic web page designing
New Web Typography
Ad

Viewers also liked (20)

PPTX
Media Matters Bootcamp may 2012
PDF
PDF
РИФ 2016, Аналитика и ее автоматизация при поисковом продвижении трафиковых п...
PPT
! иде про автоматическое кп
PPSX
03 New Linked In Profile Presentation112010
PPS
ο δρόμος
PPT
Варвари біля воріт. Принципи корпоративного управління.
PDF
Nanotechnology Mae Baan 311009
PDF
למה אני אוהב כדורגל
PDF
РИФ 2016, Поисковая оптимизация для мобильных приложений на практике
PDF
РИФ 2016, Перформанс в регионах. Блондинка.ру.
PDF
איך להפיק את המטיב מהערכת ביצועים 3
PDF
РИФ 2016, Сквозная аналитика как метод контроля подрядчика по рекламе
PDF
Floating point
PDF
РИФ 2016, Как главенство данных меняет бизнес-процессы высоконагруженного про...
PPTX
Kantara Overview June 2013
PPS
Emerveillez vous [fr-gr] vvv
PDF
Microsoft word taiwan club chinese class tutor course
PDF
רמי לוי רוצה להיות גדול
Media Matters Bootcamp may 2012
РИФ 2016, Аналитика и ее автоматизация при поисковом продвижении трафиковых п...
! иде про автоматическое кп
03 New Linked In Profile Presentation112010
ο δρόμος
Варвари біля воріт. Принципи корпоративного управління.
Nanotechnology Mae Baan 311009
למה אני אוהב כדורגל
РИФ 2016, Поисковая оптимизация для мобильных приложений на практике
РИФ 2016, Перформанс в регионах. Блондинка.ру.
איך להפיק את המטיב מהערכת ביצועים 3
РИФ 2016, Сквозная аналитика как метод контроля подрядчика по рекламе
Floating point
РИФ 2016, Как главенство данных меняет бизнес-процессы высоконагруженного про...
Kantara Overview June 2013
Emerveillez vous [fr-gr] vvv
Microsoft word taiwan club chinese class tutor course
רמי לוי רוצה להיות גדול
Ad

Similar to Grown-up javascript with AngularJS (20)

KEY
Javascript Frameworks for Well Architected, Immersive Web Apps
PDF
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
PDF
Evolving Archetecture
KEY
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
KEY
Modern Web Technologies — Jerusalem Web Professionals, January 2011
PDF
Creating an Effective Mobile API
PPTX
ql.io: Consuming HTTP at Scale
PDF
Building Cloud-Based Cross-Platform Mobile Web Apps
PDF
HTML5 and the dawn of rich mobile web applications
PDF
Building Cross Platform Mobile Web Apps
PDF
HTML5: State of the Union
PDF
Netapp Michael Galpin
PDF
A Snapshot of the Mobile HTML5 Revolution
PDF
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
PDF
Building cross platform mobile web apps
PDF
Rapid web development, the right way.
PDF
Seaside - The Revenge of Smalltalk
KEY
AJAX & jQuery - City University WAD Module
PDF
An Introduction to Sencha Touch
PDF
Bd conf sencha touch workshop
Javascript Frameworks for Well Architected, Immersive Web Apps
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Evolving Archetecture
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web Technologies — Jerusalem Web Professionals, January 2011
Creating an Effective Mobile API
ql.io: Consuming HTTP at Scale
Building Cloud-Based Cross-Platform Mobile Web Apps
HTML5 and the dawn of rich mobile web applications
Building Cross Platform Mobile Web Apps
HTML5: State of the Union
Netapp Michael Galpin
A Snapshot of the Mobile HTML5 Revolution
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
Building cross platform mobile web apps
Rapid web development, the right way.
Seaside - The Revenge of Smalltalk
AJAX & jQuery - City University WAD Module
An Introduction to Sencha Touch
Bd conf sencha touch workshop

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Approach and Philosophy of On baking technology
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
A Presentation on Artificial Intelligence
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Mushroom cultivation and it's methods.pdf
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
Tartificialntelligence_presentation.pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Approach and Philosophy of On baking technology
WOOl fibre morphology and structure.pdf for textiles
A Presentation on Artificial Intelligence
Getting Started with Data Integration: FME Form 101
Group 1 Presentation -Planning and Decision Making .pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf
Mushroom cultivation and it's methods.pdf
DP Operators-handbook-extract for the Mautical Institute
Zenith AI: Advanced Artificial Intelligence
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
cloud_computing_Infrastucture_as_cloud_p
Tartificialntelligence_presentation.pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
SOPHOS-XG Firewall Administrator PPT.pptx

Grown-up javascript with AngularJS

Editor's Notes

  • #2: What do I mean &amp;#x201C;Grown-up&amp;#x201D; Javascript?\nLecture:\n- Different approaches of web app;\n- Key features of AngularJS;\n- An example of angular JS app;\n- Let&amp;#x2019;s dive into the code and see what it takes to build an app from scratch.\n\nQuestions:\n- Who writes in JS at least once a week?\n- Who tried high-level JS frameworks. Something more fancy then Jquery?\n- Who is familiar with TDD?\n
  • #3: \n
  • #4: \n
  • #5: \n
  • #6: \n
  • #7: \n
  • #8: \n
  • #9: \n
  • #10: \n
  • #11: \n
  • #12: \n
  • #13: \n
  • #14: \n
  • #15: \n
  • #16: Forms submit breaks SPA.\nUnload servers - same problem, but on different scales.\nSmaller components - more complex development.\nThe last one is important!\n
  • #17: Forms submit breaks SPA.\nUnload servers - same problem, but on different scales.\nSmaller components - more complex development.\nThe last one is important!\n
  • #18: Forms submit breaks SPA.\nUnload servers - same problem, but on different scales.\nSmaller components - more complex development.\nThe last one is important!\n
  • #19: Forms submit breaks SPA.\nUnload servers - same problem, but on different scales.\nSmaller components - more complex development.\nThe last one is important!\n
  • #20: Forms submit breaks SPA.\nUnload servers - same problem, but on different scales.\nSmaller components - more complex development.\nThe last one is important!\n
  • #21: \n
  • #22: \n
  • #23: What is REST? It&amp;#x2019;s just a style of communication between services in the Internet which employs HTTP as a language.\n\nStateless\nCacheable\nClean\n
  • #24: It has verbs\n
  • #25: It has resources\n
  • #26: \n
  • #27: \n
  • #28: \n
  • #29: \n
  • #30: \n
  • #31: But let&amp;#x2019;s focus on web usage only. Now we have our server fully prepared to send us loads of data which we need.\n
  • #32: \n
  • #33: Javascript duck typing.\n
  • #34: \n
  • #35: \n
  • #36: \n
  • #37: If you build a really nice app, it will be recognized by the name;\nThere is still a way to do few almost static pages served by some backend, or CMS. But it will be separate app.\n
  • #38: \n
  • #39: \n
  • #40: \n
  • #41: \n
  • #42: \n
  • #43: \n
  • #44: \n
  • #45: \n
  • #46: \n
  • #47: \n
  • #48: \n
  • #49: \n
  • #50: \n
  • #51: \n
  • #52: \n
  • #53: \n
  • #54: Declarative: what the program should accomplish, rather than describing how to go about accomplishing it.\nAnd what is important, you don&amp;#x2019;t need to torture your brain each time you are going to write something like this. It comes very natural.\n
  • #55: \n
  • #56: \n
  • #57: Declatative: what the program should accomplish, rather than describing how to go about accomplishing it.\nAnd what is important, you don&amp;#x2019;t need to torture your brain each time you are going to write something like this. It comes very natural.\n
  • #58: \n
  • #59: \n
  • #60: Declatative: what the program should accomplish, rather than describing how to go about accomplishing it.\nAnd what is important, you don&amp;#x2019;t need to torture your brain each time you are going to write something like this. It comes very natural.\n
  • #61: Declatative: what the program should accomplish, rather than describing how to go about accomplishing it.\nAnd what is important, you don&amp;#x2019;t need to torture your brain each time you are going to write something like this. It comes very natural.\n
  • #62: Those of you who were into automated testing, know very well about this problem.\n
  • #63: \n
  • #64: \n
  • #65: \n
  • #66: \n
  • #67: \n
  • #68: \n
  • #69: \n
  • #70: \n