SlideShare uma empresa Scribd logo
1 de 32
Application in 24h
 Fast prototyping of rich UI applications using
                AngularJS, RequireJS, jQuery

         by Yuriy V. Silvestrov, Mikhail Valkov




                       @ysilvestrov, @valkovnet
About us

Yuriy V. Silvestrov
10+ years record in IT, 8+ years devoted to managing
projects. At the beginning of December have left Ciklum
to run a PromoRepublic startup as CTO and
cofounder.

Twitter: @ysilvestrov

Please visit my website

http://yuriy.silvestrov.com
for more info or contact me at

yuriy@silvestrov.com.


                          @ysilvestrov, @valkovnet
About us

Mikhail Valkov
10+ years record in IT. 2+ years devoted to system
architecture. Now working for   Ciklum.


for more info contact me at

valkov.net@gmail.com.




                          @ysilvestrov, @valkovnet
   Based on our own         About lection
    experience

   Useful for startups
    and pet projects

   Not the right way, not
    the best way, but the
    fast one.

   Divide and conquer 

                             @ysilvestrov, @valkovnet
⌛ < 30

Time is counting
                   @ysilvestrov, @valkovnet
   Have tried to do a startup?

   Participated in Hakatons or similar events?

   Is JavaScript/HTML5 expert?

   Is AngularJS/RequireJS expert?



   We’ll try to adapt



How many of you
                                  @ysilvestrov, @valkovnet
   Startup mode ON
    ◦ When do we need quick prototyping?
    ◦ How to quick prototype an app?
    ◦ Our “marketplace” challenge
   JavaScript DSL
    ◦ MVC in JavaScript
    ◦ AngularJS
    ◦ RequireJS, Modules and AMD
   Design DSL
    ◦ Using bootstraps (twitter etc.)
    ◦ Responsive design
   Q&A

Content
                                   @ysilvestrov, @valkovnet
 A way to write something useful and not
  to spend years on it
 Prototyping = Minimum Viable Product
  creation
    ◦ If you’ll fail, it would be fast
    ◦ If not, you’ll have plenty of time to refactor the
      application
    ◦ …while the “prototype” is still in use




Prototyping
                                    @ysilvestrov, @valkovnet
 In PromoRepublic, we’re creating promos
  like contests, lotteries etc.
 Our backend is complex .NET application
  based on Azure services
 We’d like to open marketplace to sell the
  promo templates from independent
  developers
 So we need to simplify the process for
  them, and need simple but powerful way
  to write the rich UI templates.


Marketplace challenge
                            @ysilvestrov, @valkovnet
 An ability to quickly alter UI (or create
  totally new one) leaving the promotion
  mechanic unchanged
 One app to rule them all: from mobiles to
  tablets and desktops
 < 24 hours to make it 




Promotion template:
what we’re to use it for
                           @ysilvestrov, @valkovnet
   Choose platform
   Download seed for chosen platform
   Quick UI
   Choose vital functionality to prototype
   Find the frameworks/solutions realizing
    the functionality
   Compose all together
   …
   PROFIT


How to do it FAST
                              @ysilvestrov, @valkovnet
   Plain, vanilla Client-Side JS & HTML5

   No CoffeeScript

   No node.js




Client-side JavaScript
                              @ysilvestrov, @valkovnet
   Use 3-rd party components

   Existing online services
    ◦ Prefer ones implementing REST interface
    ◦ Or having JS SDKs

   Create new ones
    ◦ create them with REST

   Use dependency managers to integrate



Component development
                                 @ysilvestrov, @valkovnet
jQuery and plugins
                     @ysilvestrov, @valkovnet
   One of 20+ MVC JS frameworks
   Supported by Google
   Integrated
    ◦   Templates
    ◦   Directives and filters
    ◦   Module systems
    ◦   Resources
    ◦   Asynchronous programming

Visit http://angularjs.org for details



Angular JS
                                   @ysilvestrov, @valkovnet
   First of all, it is simpler:
<li ng-repeat="tab in tabs" ng-class="isActive(tab.path)">
    <a href="#/{{tab.path}}">{{tab.name}}</a>
</li>
 vs
<!-- ko foreach: navigation.pages -->
<div class="body row scroll-y" data-bind="
      visible: isCurrent,
      attr: { id: 'content' + id },
      template: { name: id, 'if': isLoaded, afterRender:
afterRender }">
</div>
<!-- /ko -->




Angular JS vs Knockout JS
                                          @ysilvestrov, @valkovnet
   Then, it is faster:

   According to jsPerf tests, bindings in
    Angular 1.6 to 3 times faster than
    Knockout ones




Angular JS vs Knockout JS
                               @ysilvestrov, @valkovnet
   AngularJS has some nice features right
    from the box that I haven’t found in
    knockout

    ◦ Directives, which could be used to create
      widgets
    ◦ Integrated end to end test framework
    ◦ Filters and formatters




Angular JS vs Knockout JS
                                  @ysilvestrov, @valkovnet
 Integration with Twitter Bootstrap
 Companion AngularUI library


   AngularJS allows to create an “HTML-
    based DSL”, which include specific tags to
    solve specific tasks




Angular JS pros
                              @ysilvestrov, @valkovnet
   Load time
    ◦ Load angular + require + jquery + all the
      plugins, then load server data, then e.g. sign in
      to facebook and loaf it’s data – takes some
      time
   Databinding takes place right away, but
    services are deferred
    ◦ If to bind a GUI visible variable to a service
      result directly, user will see {{template}} while
      data loads, so that “double buffering” is
      needed.



Angular JS cons
                                   @ysilvestrov, @valkovnet
   Dependency isolation

   Dependency management

   Modules loading & cashing

Visit http://requirejs.org/ for details




RequireJS
                              @ysilvestrov, @valkovnet
   Twitter bootstrap
    http://twitter.github.com/bootstrap/
    ◦ Made for everyone




    ◦ Packed with features




Bootstrap usage
                              @ysilvestrov, @valkovnet
   Creates a lingua franca for developers and
    designers, provides a common language
    telling how the components should
    behave and look




Bootstrap usage
                              @ysilvestrov, @valkovnet
   Jasny bootstrap(http://jasny.github.com/bootstrap/)
    ◦ Row links, Input mask, File upload
    ◦ … and much more
   Kickstrap (http://getkickstrap.com/)
    ◦ Bootstrap with blackjack and hookers
    ◦ actually, with apps and themes




Twitter bootstrap extensions
                                    @ysilvestrov, @valkovnet
https://github.com/angular/angular-seed
https://github.com/ysilvestrov/angular-seed

Angular Seed
                           @ysilvestrov, @valkovnet
   Use domReady! plugin to start Angular bootstrap at a
    time

   define(['require', 'lib/angular/angular', 'app',
    'lib/angular/angular-ui'],
   function(require, angular) {
      'use strict';
      return require(['lib/require/domReady!'],
    function(document) {
         return angular.bootstrap(document, ['TwitContest']);
      });
   });




Requiring Angular:
what’s inside
                                        @ysilvestrov, @valkovnet
 Do not use “define” for controllers – you’d
  to return too much
 Use services to manage controllers
  dependencies




Requiring Angular:
practical advices
                            @ysilvestrov, @valkovnet
   The speed of first-time loading is not
    perfect; so in production minifying and
    compressing became the must

   However, RequireJS needs NodeJS for
    minification process, which is still not the
    common part of most architectures




Requiring Angular: cons
                                @ysilvestrov, @valkovnet
 Twitter have had the same problem this
  year
 It’s rather architectural then framework
  one
 Standard approach
    1.   Load common GUI template
    2.   Make series of requests to server
    3.   Load required data (pictures etc.)
    4.   Parse the data
    5.   Present it to user



Rich JS UI approach – twitter trap
                                    @ysilvestrov, @valkovnet
   Straightforward approach fails because of:
    ◦ User doesn’t want to wait seconds while
      application is loading data
    ◦ If something goes wrong (i.e. one of the
      requests fail, or JS error) – nothing is shown
   Solution:
    ◦ Prerender some data on server side and
      present it to user right away
    ◦ Redraw data on client side when it’s available




Rich JS UI approach – twitter trap
                                   @ysilvestrov, @valkovnet
???

Questions?
                   @ysilvestrov, @valkovnet
yuriy@silvestrov.com

valkov.net@gmail.com

Thank you!
Waiting for your demos

Mais conteúdo relacionado

Mais procurados

jQuery Foundation Keynote
jQuery Foundation KeynotejQuery Foundation Keynote
jQuery Foundation Keynote
Richard Worth
 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJSOCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
Jonathan Meiss
 
JHipster for Spring Boot webinar
JHipster for Spring Boot webinarJHipster for Spring Boot webinar
JHipster for Spring Boot webinar
Julien Dubois
 

Mais procurados (20)

Vuejs getting-started - Extended Version
Vuejs getting-started - Extended VersionVuejs getting-started - Extended Version
Vuejs getting-started - Extended Version
 
Java Web Application Security - Denver JUG 2013
Java Web Application Security - Denver JUG 2013Java Web Application Security - Denver JUG 2013
Java Web Application Security - Denver JUG 2013
 
Angularjs tutorial
Angularjs tutorialAngularjs tutorial
Angularjs tutorial
 
The Art of Angular in 2016 - vJUG24
The Art of Angular in 2016 - vJUG24The Art of Angular in 2016 - vJUG24
The Art of Angular in 2016 - vJUG24
 
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
 
AngularJS + React
AngularJS + ReactAngularJS + React
AngularJS + React
 
The Art of Angular in 2016 - Devoxx France 2016
The Art of Angular in 2016 - Devoxx France 2016The Art of Angular in 2016 - Devoxx France 2016
The Art of Angular in 2016 - Devoxx France 2016
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework
 
The Art of Angular in 2016 - Devoxx UK 2016
The Art of Angular in 2016 - Devoxx UK 2016The Art of Angular in 2016 - Devoxx UK 2016
The Art of Angular in 2016 - Devoxx UK 2016
 
Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceAutomated perf optimization - jQuery Conference
Automated perf optimization - jQuery Conference
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
Learn react the right way
Learn react the right way  Learn react the right way
Learn react the right way
 
Web Frameworks of the Future: Flex, GWT, Grails and Rails
Web Frameworks of the Future: Flex, GWT, Grails and RailsWeb Frameworks of the Future: Flex, GWT, Grails and Rails
Web Frameworks of the Future: Flex, GWT, Grails and Rails
 
jQuery Foundation Keynote
jQuery Foundation KeynotejQuery Foundation Keynote
jQuery Foundation Keynote
 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJSOCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
 
jQuery Keynote - Fall 2010
jQuery Keynote - Fall 2010jQuery Keynote - Fall 2010
jQuery Keynote - Fall 2010
 
Get Hip with JHipster - Denver JUG 2015
Get Hip with JHipster - Denver JUG 2015Get Hip with JHipster - Denver JUG 2015
Get Hip with JHipster - Denver JUG 2015
 
jQuery Mobile Overview - Boston
jQuery Mobile  Overview -  BostonjQuery Mobile  Overview -  Boston
jQuery Mobile Overview - Boston
 
JHipster for Spring Boot webinar
JHipster for Spring Boot webinarJHipster for Spring Boot webinar
JHipster for Spring Boot webinar
 
What's new in Angular 2?
What's new in Angular 2?What's new in Angular 2?
What's new in Angular 2?
 

Destaque

Descubre Villaviciosa De OdóN
Descubre  Villaviciosa De OdóNDescubre  Villaviciosa De OdóN
Descubre Villaviciosa De OdóN
50045882
 
euroFOT, Aachener Kolloquium, Ford
euroFOT, Aachener Kolloquium, FordeuroFOT, Aachener Kolloquium, Ford
euroFOT, Aachener Kolloquium, Ford
euroFOT
 
Full Day Kindergarten
Full Day KindergartenFull Day Kindergarten
Full Day Kindergarten
guest8c7eb4
 
No access to technology - by Michelle
No access to technology - by MichelleNo access to technology - by Michelle
No access to technology - by Michelle
Amalia Giebitz
 
How to register a project
How to register a projectHow to register a project
How to register a project
ivanabrabcova
 

Destaque (20)

AngularJS with RequireJS
AngularJS with RequireJSAngularJS with RequireJS
AngularJS with RequireJS
 
Descubre Villaviciosa De OdóN
Descubre  Villaviciosa De OdóNDescubre  Villaviciosa De OdóN
Descubre Villaviciosa De OdóN
 
AHC Network Monitoring Plan
AHC Network Monitoring PlanAHC Network Monitoring Plan
AHC Network Monitoring Plan
 
euroFOT, Aachener Kolloquium, Ford
euroFOT, Aachener Kolloquium, FordeuroFOT, Aachener Kolloquium, Ford
euroFOT, Aachener Kolloquium, Ford
 
Grammar Focus
Grammar FocusGrammar Focus
Grammar Focus
 
初めてのプラグイン開発
初めてのプラグイン開発初めてのプラグイン開発
初めてのプラグイン開発
 
Full Day Kindergarten
Full Day KindergartenFull Day Kindergarten
Full Day Kindergarten
 
Stewart Townsend - #smib10 Presentation
Stewart Townsend - #smib10 PresentationStewart Townsend - #smib10 Presentation
Stewart Townsend - #smib10 Presentation
 
ProMAMA Center
ProMAMA CenterProMAMA Center
ProMAMA Center
 
No access to technology - by Michelle
No access to technology - by MichelleNo access to technology - by Michelle
No access to technology - by Michelle
 
How to register a project
How to register a projectHow to register a project
How to register a project
 
Verbkonjugation
VerbkonjugationVerbkonjugation
Verbkonjugation
 
Slidecast Sander Gansbeke
Slidecast Sander GansbekeSlidecast Sander Gansbeke
Slidecast Sander Gansbeke
 
Matrix Safety Catolgue 1
Matrix Safety Catolgue 1Matrix Safety Catolgue 1
Matrix Safety Catolgue 1
 
Smoking Hypnosis - Say No To The Cancer Sticks
Smoking Hypnosis - Say No To The Cancer SticksSmoking Hypnosis - Say No To The Cancer Sticks
Smoking Hypnosis - Say No To The Cancer Sticks
 
Kutadgu profile nov2012
Kutadgu profile nov2012Kutadgu profile nov2012
Kutadgu profile nov2012
 
мобильный смарт фитнес
мобильный смарт фитнесмобильный смарт фитнес
мобильный смарт фитнес
 
Digital & Concept Artist: come diventare autori di successo (free webinar)
Digital & Concept Artist: come diventare autori di successo (free webinar)Digital & Concept Artist: come diventare autori di successo (free webinar)
Digital & Concept Artist: come diventare autori di successo (free webinar)
 
Why Simple Works
Why Simple WorksWhy Simple Works
Why Simple Works
 
Case study twitter
Case study twitterCase study twitter
Case study twitter
 

Semelhante a JS FAST Prototyping with AngularJS & RequireJS

Prototyping app using JS and HTML5 (Ciklum Kharkiv)
Prototyping app using JS and HTML5 (Ciklum Kharkiv)Prototyping app using JS and HTML5 (Ciklum Kharkiv)
Prototyping app using JS and HTML5 (Ciklum Kharkiv)
Yuriy Silvestrov
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwist
Mark Fayngersh
 
SnapyX
SnapyXSnapyX
SnapyX
ekino
 

Semelhante a JS FAST Prototyping with AngularJS & RequireJS (20)

Prototyping app using JS and HTML5 (Ciklum Kharkiv)
Prototyping app using JS and HTML5 (Ciklum Kharkiv)Prototyping app using JS and HTML5 (Ciklum Kharkiv)
Prototyping app using JS and HTML5 (Ciklum Kharkiv)
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwist
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
Yeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web appsYeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web apps
 
Integrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMSIntegrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMS
 
AngularJS : Superheroic Javascript MVW Framework
AngularJS : Superheroic Javascript MVW FrameworkAngularJS : Superheroic Javascript MVW Framework
AngularJS : Superheroic Javascript MVW Framework
 
Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019
 
JavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) uploadJavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) upload
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
 
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
 
Webinar on Angular JS titled 'Develop Responsive Single Page Application'
Webinar on Angular JS titled 'Develop Responsive Single Page Application'Webinar on Angular JS titled 'Develop Responsive Single Page Application'
Webinar on Angular JS titled 'Develop Responsive Single Page Application'
 
SnapyX
SnapyXSnapyX
SnapyX
 
SnapyX - ParisJS
SnapyX - ParisJSSnapyX - ParisJS
SnapyX - ParisJS
 
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
 
Bdd with Cucumber and Mocha
Bdd with Cucumber and MochaBdd with Cucumber and Mocha
Bdd with Cucumber and Mocha
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Angular js workshop
Angular js workshopAngular js workshop
Angular js workshop
 
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
 
Welcome to Wijmo 5
Welcome to Wijmo 5Welcome to Wijmo 5
Welcome to Wijmo 5
 

Mais de Yuriy Silvestrov

Agile antipatterns - AgileBC
Agile antipatterns - AgileBCAgile antipatterns - AgileBC
Agile antipatterns - AgileBC
Yuriy Silvestrov
 

Mais de Yuriy Silvestrov (8)

How to run asp.net on virtual server for $5 per mo
How to run asp.net on  virtual server for $5 per moHow to run asp.net on  virtual server for $5 per mo
How to run asp.net on virtual server for $5 per mo
 
Startups intro to agile (по-русски)
Startups intro to agile (по-русски)Startups intro to agile (по-русски)
Startups intro to agile (по-русски)
 
Developing the startup (in Russian)
Developing the startup (in Russian)Developing the startup (in Russian)
Developing the startup (in Russian)
 
Startup agile (Ciklum Agile Saturday - Dnipropetrovsk) - in russian
Startup agile (Ciklum Agile Saturday - Dnipropetrovsk) - in russianStartup agile (Ciklum Agile Saturday - Dnipropetrovsk) - in russian
Startup agile (Ciklum Agile Saturday - Dnipropetrovsk) - in russian
 
Developing the ideas
Developing the ideasDeveloping the ideas
Developing the ideas
 
Agile antipatterns - AgileBC
Agile antipatterns - AgileBCAgile antipatterns - AgileBC
Agile antipatterns - AgileBC
 
Agile antipatterns (Odessa, Vinnitsa)
Agile antipatterns (Odessa, Vinnitsa)Agile antipatterns (Odessa, Vinnitsa)
Agile antipatterns (Odessa, Vinnitsa)
 
Catch agile
Catch agileCatch agile
Catch agile
 

JS FAST Prototyping with AngularJS & RequireJS

  • 1. Application in 24h Fast prototyping of rich UI applications using AngularJS, RequireJS, jQuery by Yuriy V. Silvestrov, Mikhail Valkov @ysilvestrov, @valkovnet
  • 2. About us Yuriy V. Silvestrov 10+ years record in IT, 8+ years devoted to managing projects. At the beginning of December have left Ciklum to run a PromoRepublic startup as CTO and cofounder. Twitter: @ysilvestrov Please visit my website http://yuriy.silvestrov.com for more info or contact me at yuriy@silvestrov.com. @ysilvestrov, @valkovnet
  • 3. About us Mikhail Valkov 10+ years record in IT. 2+ years devoted to system architecture. Now working for Ciklum. for more info contact me at valkov.net@gmail.com. @ysilvestrov, @valkovnet
  • 4. Based on our own About lection experience  Useful for startups and pet projects  Not the right way, not the best way, but the fast one.  Divide and conquer  @ysilvestrov, @valkovnet
  • 5. ⌛ < 30 Time is counting @ysilvestrov, @valkovnet
  • 6. Have tried to do a startup?  Participated in Hakatons or similar events?  Is JavaScript/HTML5 expert?  Is AngularJS/RequireJS expert?  We’ll try to adapt How many of you @ysilvestrov, @valkovnet
  • 7. Startup mode ON ◦ When do we need quick prototyping? ◦ How to quick prototype an app? ◦ Our “marketplace” challenge  JavaScript DSL ◦ MVC in JavaScript ◦ AngularJS ◦ RequireJS, Modules and AMD  Design DSL ◦ Using bootstraps (twitter etc.) ◦ Responsive design  Q&A Content @ysilvestrov, @valkovnet
  • 8.  A way to write something useful and not to spend years on it  Prototyping = Minimum Viable Product creation ◦ If you’ll fail, it would be fast ◦ If not, you’ll have plenty of time to refactor the application ◦ …while the “prototype” is still in use Prototyping @ysilvestrov, @valkovnet
  • 9.  In PromoRepublic, we’re creating promos like contests, lotteries etc.  Our backend is complex .NET application based on Azure services  We’d like to open marketplace to sell the promo templates from independent developers  So we need to simplify the process for them, and need simple but powerful way to write the rich UI templates. Marketplace challenge @ysilvestrov, @valkovnet
  • 10.  An ability to quickly alter UI (or create totally new one) leaving the promotion mechanic unchanged  One app to rule them all: from mobiles to tablets and desktops  < 24 hours to make it  Promotion template: what we’re to use it for @ysilvestrov, @valkovnet
  • 11. Choose platform  Download seed for chosen platform  Quick UI  Choose vital functionality to prototype  Find the frameworks/solutions realizing the functionality  Compose all together  …  PROFIT How to do it FAST @ysilvestrov, @valkovnet
  • 12. Plain, vanilla Client-Side JS & HTML5  No CoffeeScript  No node.js Client-side JavaScript @ysilvestrov, @valkovnet
  • 13. Use 3-rd party components  Existing online services ◦ Prefer ones implementing REST interface ◦ Or having JS SDKs  Create new ones ◦ create them with REST  Use dependency managers to integrate Component development @ysilvestrov, @valkovnet
  • 14. jQuery and plugins @ysilvestrov, @valkovnet
  • 15. One of 20+ MVC JS frameworks  Supported by Google  Integrated ◦ Templates ◦ Directives and filters ◦ Module systems ◦ Resources ◦ Asynchronous programming Visit http://angularjs.org for details Angular JS @ysilvestrov, @valkovnet
  • 16. First of all, it is simpler: <li ng-repeat="tab in tabs" ng-class="isActive(tab.path)"> <a href="#/{{tab.path}}">{{tab.name}}</a> </li>  vs <!-- ko foreach: navigation.pages --> <div class="body row scroll-y" data-bind=" visible: isCurrent, attr: { id: 'content' + id }, template: { name: id, 'if': isLoaded, afterRender: afterRender }"> </div> <!-- /ko --> Angular JS vs Knockout JS @ysilvestrov, @valkovnet
  • 17. Then, it is faster:  According to jsPerf tests, bindings in Angular 1.6 to 3 times faster than Knockout ones Angular JS vs Knockout JS @ysilvestrov, @valkovnet
  • 18. AngularJS has some nice features right from the box that I haven’t found in knockout ◦ Directives, which could be used to create widgets ◦ Integrated end to end test framework ◦ Filters and formatters Angular JS vs Knockout JS @ysilvestrov, @valkovnet
  • 19.  Integration with Twitter Bootstrap  Companion AngularUI library  AngularJS allows to create an “HTML- based DSL”, which include specific tags to solve specific tasks Angular JS pros @ysilvestrov, @valkovnet
  • 20. Load time ◦ Load angular + require + jquery + all the plugins, then load server data, then e.g. sign in to facebook and loaf it’s data – takes some time  Databinding takes place right away, but services are deferred ◦ If to bind a GUI visible variable to a service result directly, user will see {{template}} while data loads, so that “double buffering” is needed. Angular JS cons @ysilvestrov, @valkovnet
  • 21. Dependency isolation  Dependency management  Modules loading & cashing Visit http://requirejs.org/ for details RequireJS @ysilvestrov, @valkovnet
  • 22. Twitter bootstrap http://twitter.github.com/bootstrap/ ◦ Made for everyone ◦ Packed with features Bootstrap usage @ysilvestrov, @valkovnet
  • 23. Creates a lingua franca for developers and designers, provides a common language telling how the components should behave and look Bootstrap usage @ysilvestrov, @valkovnet
  • 24. Jasny bootstrap(http://jasny.github.com/bootstrap/) ◦ Row links, Input mask, File upload ◦ … and much more  Kickstrap (http://getkickstrap.com/) ◦ Bootstrap with blackjack and hookers ◦ actually, with apps and themes Twitter bootstrap extensions @ysilvestrov, @valkovnet
  • 26. Use domReady! plugin to start Angular bootstrap at a time  define(['require', 'lib/angular/angular', 'app', 'lib/angular/angular-ui'],  function(require, angular) {  'use strict';  return require(['lib/require/domReady!'], function(document) {  return angular.bootstrap(document, ['TwitContest']);  });  }); Requiring Angular: what’s inside @ysilvestrov, @valkovnet
  • 27.  Do not use “define” for controllers – you’d to return too much  Use services to manage controllers dependencies Requiring Angular: practical advices @ysilvestrov, @valkovnet
  • 28. The speed of first-time loading is not perfect; so in production minifying and compressing became the must  However, RequireJS needs NodeJS for minification process, which is still not the common part of most architectures Requiring Angular: cons @ysilvestrov, @valkovnet
  • 29.  Twitter have had the same problem this year  It’s rather architectural then framework one  Standard approach 1. Load common GUI template 2. Make series of requests to server 3. Load required data (pictures etc.) 4. Parse the data 5. Present it to user Rich JS UI approach – twitter trap @ysilvestrov, @valkovnet
  • 30. Straightforward approach fails because of: ◦ User doesn’t want to wait seconds while application is loading data ◦ If something goes wrong (i.e. one of the requests fail, or JS error) – nothing is shown  Solution: ◦ Prerender some data on server side and present it to user right away ◦ Redraw data on client side when it’s available Rich JS UI approach – twitter trap @ysilvestrov, @valkovnet
  • 31. ??? Questions? @ysilvestrov, @valkovnet