SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
Angular or Backbone: Go Mobile! 
Doris Chen Ph.D. 
Senior Developer Evangelist 
Microsoft 
doris.chen@microsoft.com 
http://blogs.msdn.com/dorischen/ 
@doristchen
Doris Chen, Ph.D. 
•Developer Evangelist at Microsoft based in Silicon Valley, CA 
•Blog: http://blogs.msdn.com/b/dorischen/ 
•Twitter @doristchen 
•Email: doris.chen@microsoft.com 
•Over 18 years of experience in the software industry focusing on web technologies 
•Spoke and published widely at O'Reilly OSCON, Fluent, HTML5 Dev Conf, JavaOne, Google Developer Conference, Silicon Valley Code Camp and worldwide User Groups meetups 
•Doris received her Ph.D. from the University of California at Los Angeles (UCLA)
Agenda 
1.Angular vs Backbone 
2.Demo: ToDoApp in Angular and Backbone 
3.Mobile Apps for JavaScript 
4.Demo: ToDoApp with Apache Cordova 
5.Summary and Resources
Angular vs Backbone
Angular vs Backbone: common 
•Client-side framework using the MV* design pattern 
•Solve the problem of Single Page Web Applications 
•Structure 
•Modular 
•Support multiple clients 
•Both open-sourced, under the permissive MIT license 
•Have the concept of views, events, data models and routing
History 
Angular 
•Born in 2009 as a part of commercial product, called GetAngular 
•MiskoHevery, one of founders, turn a web application 
•17,000 lines in 6 months to 1,000 lines in 3 weeks using just GetAngular 
•Google starts sponsoring, becomes open-source Angular.js 
Backbone 
•Born in 2010, lightweight MVC framework/library 
•As a lean alternative to heavy, full-featured MVC (MVVC) frameworks such as ExtJS
Learning curve and Flexibility 
Angular 
•Looks quite easy at first sight 
•After the very basics it is quite a steep learning curve from there 
•Highly opinionated 
•Fighting the framework if you don’t like the way it does certain things 
•Reading the documentation is not easy as a lot of Angular specific jargon 
•Lack of examples 
Backbone 
•Basic of backbone is very easy to learn 
•Not opinionated 
•most flexible framework with the less conventions and opinions 
•Need to make a lot of decisions when using Backbone 
•Need to watch or read a few tutorials to learn some best Backbone practices 
•probably need to learn another library on top of Backbone (e.g. Marionette or Thorax)
Community 
Metric 
Angular 
Backbone 
Stars on GitHub 
29.8k 
19.3k 
Third-Party Modules 
800 ngmodules 
236 backplugs 
StackOverflowQuestions 
49.5k 
15.9k 
YouTube Results 
~75k 
~16k 
GitHub Contributors 
928 
230 
Chrome Extension Users 
150k 
7k
Angular 
Backbone 
Architecture 
MV* (Model View Whatever) 
MV + VC 
Template Support 
YES. doesn’t require any other separate template engine.(Also doesn’t support template engine) 
Uses underscore.js( an embedded template engine which allows logic inside template code) 
File Size 
39.5K (no dependencies) 
6.5K -43.5K (w/underscore& jQuery) 
Nested Template Support 
Yes 
No 
Data Binding 
Yes 
No 
Routing 
Yes 
Yes 
Compatible with other frameworks 
Yes 
Yes 
Additional Features 
Dependency Injection, Directives, Watch Expressions and 2-way Binding, HTML5 validations, Form Validations, and Filtering
Angular: templates 
•Simply HTML with binding expressions baked-in 
•Binding expressions are surrounded by double curly braces 
<ul> 
<li ="framework in frameworks" 
title="{{framework.description}}"> 
{{framework.name}} 
</li> 
</ul>
Backbone: templates 
<ul> 
<% _.each(frameworks, function(framework) { %> 
<li title="<%-framework.description%>"> 
<%-framework.name %> 
</li> 
<% }); %> 
</ul> 
Underscore is very basic and you usually have to throw JavaScript into the mix
Angular: model 
•Angular does not use observable properties, no restriction on implementing model 
•No class to extend and no interface to comply 
•Free to use whatever you want (including existing Backbone models) 
•In practice, most developers use plain old JavaScript objects (POJO)
Backbone: modelapp.TodoModel= Backbone.Model.extend({ defaults: { title: '', done: false, location: 'Getting your location...' }, toggleCompleted: function() { this.save({ done: !this.get('done') }); }, sync: function() { returnfalse; } 
});
Backbone: modeland collectionvarTodoCollection= Backbone.Collection.extend({ model: app.TodoModel, }); app.todoCollection= newTodoCollection; 
•Backbone is built around observable properties, forcedto extend Backbone.Modeland Backbone.Collection 
•Backbone does not support observing functions, property needs to resetwhen any change happens
Angular: good things 
•Two-way data bindings, dependency injection, easy-to-test code, extending the HTML dialect by using directives, out of the box filters, reusableservicesand factories 
•Minimizes drastically the boilerplate code, no direct DOM manipulation 
•The automatic Dirty Checking 
•No need getters and setters 
•modify property and angular automatically detects the change and notify all the watchers
2-way bindings and directives<divclass="templateWrapper"ng-repeat="toDoItemin todos"> <divclass="templateContainer"> <inputclass="templateTitle" ng-class="{crossedOut: toDoItem.done}"type="text" ng-text-change="changeToDoText(toDoItem)" ng-model="toDoItem.text"/> <h3class="templateAddress">{{toDoItem.address}}</h3> </div> </div>
Dependency injection<sectionid="todoapp"ng-controller="ToDoCtrl"> <buttonclass="templateLefttemplateRemove" ng-click="removeToDo(toDoItem)"></button> </section> angular.module("xPlat.controllers") .controller('ToDoCtrl', ['$scope', 'maps', 'storage', function($scope, maps, storage) { $scope.removeToDo= function(toDoItem) { storage.del(toDoItem).then(function(todo) { varindex =$scope.todos.indexOf(todo); $scope.todos.splice(index, 1); }); } }]);
Angular: more good things 
•Building application blocks into: Controllers, Directives, Factories, Filters, Services and Views (templates). 
•ViewsUI, Controllerslogic behind UI, Servicescommunication with backend and common functionality, Directivesreusable components and extendingHTMLby defining new elements, attributes and behaviors 
•Promisesplay a main role in Angular
Custom directives<inputclass="templateTitle" ng-class="{crossedOut: toDoItem.done}"type="text" ng-text-change=" changeToDoText(toDoItem)" ng-model="toDoItem.text"/> angular.module('xPlat.directives') .directive('ngTextChange', function() { return{ restrict: 'A', replace: 'ngModel', link: function(scope, element, attr) { element.on('change', function() { scope.$apply(function() { scope.$eval(attr.ngTextChange); }); … });
Custom directives, continued$scope.changeToDoText= function(toDoItem) { //Notice .then Promisepattern is used heregetAddress().then(function(address) { toDoItem.address= address; returnstorage.update(toDoItem); }, function(errorMessage) { toDoItem.address= errorMessage; returnstorage.update(toDoItem); }); }
Angular: bad things 
•Extremely opinionated 
•Frustrated: prior experience in creating UI with Javascriptis rendered almost useless 
•Do everything according to the “Angular way” 
•Directives could be super complicated and odd 
•Expression language too powerful 
•<buttonng-click="(oldPassword&& checkComplexity(newPassword) && oldPassword!= newPassword) ? (changePassword(oldPassword, newPassword) && (oldPassword=(newPassword=''))) : (errorMessage='Please input a new password matching the following requirements: ' + passwordRequirements)">Click me</button>
Backbone: good things 
•Compact, minimal, not opinionated 
•Resembles classic Javascriptthe most 
•Has the least learning curve 
•Huge community (ecosystem) and lots of solutions on StackOverflow 
•Many popular applications 
•Twitter, Foursquare, LinkedIn Mobile, Soundcloud, Pitchfork, Pandora, Pinterest, Flixster, AirBNB
Backbone: bad things 
•Hands off: Needto develop own 
•Application Architecture / Layout Structure / Memory management/ 
•Too much option of bringing third party plugins 
•Cost time to do research, it’s not so minimal and becomes opinionated 
•Lacking features compared to the newer frameworks 
•No data binding 
•a lot of boiler plate code to make it work well 
•doesn’t allow easy iteration through UI variants 
•No nested model 
•userModel.get("name").first = "Tom"; userModel.set("name.first","Tom"); --can’t do 
•Views manipulate the DOM directly, making them really hard to unit- test, more fragile and less reusable.
Backbone vs AngularupdateCrossOut: function() { if(this.model.get('done')) { this.$input.addClass('crossedOut'); … … } else{ this.$input.removeClass('crossedOut'); … … }}, <inputclass="templateTitle" ng-class="{crossedOut: toDoItem.done}"… ng-model="toDoItem.text"/>
Performance Comparison: TodoMVCBenchmark 
•Angular (v1.2.14), Backbone (v1.1.2) + jQuery (v2.1.0) 
•Test case: 
•Add 100 todos, toggle them one by one, then delete them one by one, 
•10 runs average 
•Data collected on an Late 2013 Retina MacbookPro 13 with a 2.6GHz dual-core i5-4288U Processor under OS X Mavericks 10.9.1. 
•Average Response on Chrome 33, Firefox 28 and Safari 7 
•AngularJS1617.72ms 
•Backbone833.36ms 
•http://vuejs.org/perf/
Demo 
ToDoMVC in Angular and Backbone
When to use Angular? 
•Something declarative that uses View to derive behavior 
•Custom HTML tags and components that specify your application intentions 
•Easily testable, URL management (routing) and a separation of concerns through a variation of MVC 
•Good at making quick changes 
•create easily testable code and test it often 
•Not a good fit for Angular 
•Games and GUI editors are examples of applications with intensive and tricky DOM manipulation, different from CRUD apps 
•may be better to use a library like jQuery 
•Has its own scaffolding tools available (angular-seed)
When to use Backbone? 
•Something flexible, offers a minimalist solution 
•Support a persistence layer and RESTfulsync, models, views (with controllers), event-driven communication, templatingand routing 
•Imperative, update View when model changes 
•Like some decisions about the architecture left to you 
•Building something complex, 
•Active extension community Marionette62, Chaplin63, Aura64, Thorax65 
•Scaffolding tools (grunt-bbb66, brunch67)
Go mobile 
From web app to hybrid app
Apps dominate the mobile web
Low investment for more capabilities 
Capabilities 
Developer Investment 
Web App 
Hybrid App 
Native App
World Wide Web 
Hybrid 
Deliverymechanism 
Delivered via browser 
Packagedon my device 
Input 
Touch 
Touch 
Offline Support 
No 
Yes 
DeviceCapabilities 
Web APIs Only 
Native Device APIs 
Monetization 
Web Commerce 
App Store & In-App Purchases 
Discoverability 
Bookmarks & Search Engines 
Always on my home screen 

What is Apache Cordova? 
•Open-source framework
Native Wrapper 
What is Apache Cordova? 
•Open-source framework 
•Hosted webview 
•Single, shared codebase deployed to all targets 
<webview> Your JavaScript App
Native Wrapper 
What is Apache Cordova? 
•Open-source framework 
•Hosted webview 
•Single, shared codebase deployed to all targets 
•Plugins provide a common JavaScript API to access device capabilities 
<webview> Your JavaScript App 
Cordova Plugin JS API
Native Wrapper 
What is Apache Cordova? 
•Open-source framework 
•Hosted webview 
•Single, shared codebase deployed to all targets 
•Plugins provide a common JavaScript API to access device capabilities 
•About 6% of apps in stores (13% in enterprise) 
<webview> Your JavaScript App 
Cordova Plugin JS API
Demo 
Converting ToDoMVC into a hybrid app
Tips, Tricks & Considerations 
•Use Cordova when an idea makes sense as a web app, but you need… 
•Cross-platform support as a packaged application 
•Offline support 
•Access to native device capabilities (e.g. camera, accelerometer, file system) 
•Better reach & discoverability 
•If you’re building a first-person shooter… go native. 
•Cordova depends on the platform build system 
•To build for iOS, you need a Mac 
•To build for Windows 8+, you need Windows 8+ 
•To build for Android, you need the Android SDK 
•Touch input means bigger everything. Consider a control framework like Ionic.
Summary 
•Backbone was easier to learn compared to Angular 
•Backbone tends to be faster than Angular in ToDoMVCperftests 
•Angular resulted in fewer lines code than Backbone for our app making it easier to maintain 
•Angular provided far more features (e.g. data-binding, custom directives, declarative markup) 
•Converting both frameworks to mobile was equally simple via Apache Cordova
Resources 
•AngularJS: http://angularjs.org 
•BackboneJS:http://backbonejs.org 
•ToDoMVC: http://todomvc.com 
•Tools for Apache Cordova: http://aka.ms/cordova 
•StackOverflow#multi-device-hybrid-apps

Weitere ähnliche Inhalte

Was ist angesagt?

[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JSIvano Malavolta
 
HTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile appsHTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile appsIvano Malavolta
 
HTML5: the new frontier of the web
HTML5: the new frontier of the webHTML5: the new frontier of the web
HTML5: the new frontier of the webIvano Malavolta
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPMohammad Shaker
 
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery TrainingCartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery TrainingShane Church
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQueryAlek Davis
 
Modern development paradigms
Modern development paradigmsModern development paradigms
Modern development paradigmsIvano Malavolta
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Matt Raible
 
Building intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryBuilding intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryAlek Davis
 
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVAYash Mody
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsJulien Lecomte
 
The Art of AngularJS in 2015
The Art of AngularJS in 2015The Art of AngularJS in 2015
The Art of AngularJS in 2015Matt Raible
 
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint BeastMark Rackley
 
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave TaylorAtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave TaylorAtlassian
 
SharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuerySharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQueryMark Rackley
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownSPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownMark Rackley
 
JsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery TemplatesJsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery TemplatesBorisMoore
 
SPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentialsSPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentialsMark Rackley
 

Was ist angesagt? (20)

[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS
 
HTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile appsHTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile apps
 
HTML5: the new frontier of the web
HTML5: the new frontier of the webHTML5: the new frontier of the web
HTML5: the new frontier of the web
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
 
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery TrainingCartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Modern development paradigms
Modern development paradigmsModern development paradigms
Modern development paradigms
 
Fast mobile web apps
Fast mobile web appsFast mobile web apps
Fast mobile web apps
 
Getting started with angular js
Getting started with angular jsGetting started with angular js
Getting started with angular js
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
 
Building intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryBuilding intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQuery
 
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVA
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
The Art of AngularJS in 2015
The Art of AngularJS in 2015The Art of AngularJS in 2015
The Art of AngularJS in 2015
 
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
 
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave TaylorAtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
 
SharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuerySharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuery
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownSPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have known
 
JsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery TemplatesJsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery Templates
 
SPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentialsSPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentials
 

Ähnlich wie Angular or Backbone: Go Mobile!

jquery summit presentation for large scale javascript applications
jquery summit  presentation for large scale javascript applicationsjquery summit  presentation for large scale javascript applications
jquery summit presentation for large scale javascript applicationsDivyanshGupta922023
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletonGeorge Nguyen
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - DirectivesWebStackAcademy
 
P Training Presentation
P Training PresentationP Training Presentation
P Training PresentationGaurav Tyagi
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day trainingTroy Miles
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
Viking academy backbone.js
Viking academy  backbone.jsViking academy  backbone.js
Viking academy backbone.jsBert Wijnants
 
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsAviran Cohen
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedGil Fink
 
gDayX - Advanced angularjs
gDayX - Advanced angularjsgDayX - Advanced angularjs
gDayX - Advanced angularjsgdgvietnam
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAmir Barylko
 
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android AppsUsing Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android AppsLuis Cruz
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsRan Mizrahi
 

Ähnlich wie Angular or Backbone: Go Mobile! (20)

JS Essence
JS EssenceJS Essence
JS Essence
 
jquery summit presentation for large scale javascript applications
jquery summit  presentation for large scale javascript applicationsjquery summit  presentation for large scale javascript applications
jquery summit presentation for large scale javascript applications
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
 
AngularJS Workshop
AngularJS WorkshopAngularJS Workshop
AngularJS Workshop
 
P Training Presentation
P Training PresentationP Training Presentation
P Training Presentation
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day training
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Viking academy backbone.js
Viking academy  backbone.jsViking academy  backbone.js
Viking academy backbone.js
 
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS Fundamentals
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Intro to AngularJs
Intro to AngularJsIntro to AngularJs
Intro to AngularJs
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
Angular js
Angular jsAngular js
Angular js
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
 
gDayX - Advanced angularjs
gDayX - Advanced angularjsgDayX - Advanced angularjs
gDayX - Advanced angularjs
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescript
 
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android AppsUsing Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
 
AngularJS
AngularJSAngularJS
AngularJS
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design Patterns
 

Mehr von Doris Chen

Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Doris Chen
 
Lastest Trends in Web Development
Lastest Trends in Web DevelopmentLastest Trends in Web Development
Lastest Trends in Web DevelopmentDoris Chen
 
OSCON Presentation: Developing High Performance Websites and Modern Apps with...
OSCON Presentation: Developing High Performance Websites and Modern Apps with...OSCON Presentation: Developing High Performance Websites and Modern Apps with...
OSCON Presentation: Developing High Performance Websites and Modern Apps with...Doris Chen
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterDoris Chen
 
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5Doris Chen
 
What Web Developers Need to Know to Develop Native HTML5/JS Apps
What Web Developers Need to Know to Develop Native HTML5/JS AppsWhat Web Developers Need to Know to Develop Native HTML5/JS Apps
What Web Developers Need to Know to Develop Native HTML5/JS AppsDoris Chen
 
Windows 8 Opportunity
Windows 8 OpportunityWindows 8 Opportunity
Windows 8 OpportunityDoris Chen
 
Wins8 appfoforweb fluent
Wins8 appfoforweb fluentWins8 appfoforweb fluent
Wins8 appfoforweb fluentDoris Chen
 
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...Doris Chen
 
What Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 AppsWhat Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 AppsDoris Chen
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Doris Chen
 
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3Doris Chen
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3Doris Chen
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Doris Chen
 
Practical HTML5: Using It Today
Practical HTML5: Using It TodayPractical HTML5: Using It Today
Practical HTML5: Using It TodayDoris Chen
 
Dive Into HTML5
Dive Into HTML5Dive Into HTML5
Dive Into HTML5Doris Chen
 
Practical HTML5: Using It Today
Practical HTML5: Using It TodayPractical HTML5: Using It Today
Practical HTML5: Using It TodayDoris Chen
 
HTML 5 Development for Windows Phone and Desktop
HTML 5 Development for Windows Phone and DesktopHTML 5 Development for Windows Phone and Desktop
HTML 5 Development for Windows Phone and DesktopDoris Chen
 
Dive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDoris Chen
 
Performance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesPerformance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesDoris Chen
 

Mehr von Doris Chen (20)

Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016
 
Lastest Trends in Web Development
Lastest Trends in Web DevelopmentLastest Trends in Web Development
Lastest Trends in Web Development
 
OSCON Presentation: Developing High Performance Websites and Modern Apps with...
OSCON Presentation: Developing High Performance Websites and Modern Apps with...OSCON Presentation: Developing High Performance Websites and Modern Apps with...
OSCON Presentation: Developing High Performance Websites and Modern Apps with...
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
 
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
 
What Web Developers Need to Know to Develop Native HTML5/JS Apps
What Web Developers Need to Know to Develop Native HTML5/JS AppsWhat Web Developers Need to Know to Develop Native HTML5/JS Apps
What Web Developers Need to Know to Develop Native HTML5/JS Apps
 
Windows 8 Opportunity
Windows 8 OpportunityWindows 8 Opportunity
Windows 8 Opportunity
 
Wins8 appfoforweb fluent
Wins8 appfoforweb fluentWins8 appfoforweb fluent
Wins8 appfoforweb fluent
 
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
 
What Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 AppsWhat Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 Apps
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
 
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
 
Practical HTML5: Using It Today
Practical HTML5: Using It TodayPractical HTML5: Using It Today
Practical HTML5: Using It Today
 
Dive Into HTML5
Dive Into HTML5Dive Into HTML5
Dive Into HTML5
 
Practical HTML5: Using It Today
Practical HTML5: Using It TodayPractical HTML5: Using It Today
Practical HTML5: Using It Today
 
HTML 5 Development for Windows Phone and Desktop
HTML 5 Development for Windows Phone and DesktopHTML 5 Development for Windows Phone and Desktop
HTML 5 Development for Windows Phone and Desktop
 
Dive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDive into HTML5: SVG and Canvas
Dive into HTML5: SVG and Canvas
 
Performance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesPerformance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best Practices
 

Kürzlich hochgeladen

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 textsMaria Levchenko
 
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 educationjfdjdjcjdnsjd
 
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.pptxHampshireHUG
 
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...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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...Martijn de Jong
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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.pdfhans926745
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Kürzlich hochgeladen (20)

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
 
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
 
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
 
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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Angular or Backbone: Go Mobile!

  • 1. Angular or Backbone: Go Mobile! Doris Chen Ph.D. Senior Developer Evangelist Microsoft doris.chen@microsoft.com http://blogs.msdn.com/dorischen/ @doristchen
  • 2. Doris Chen, Ph.D. •Developer Evangelist at Microsoft based in Silicon Valley, CA •Blog: http://blogs.msdn.com/b/dorischen/ •Twitter @doristchen •Email: doris.chen@microsoft.com •Over 18 years of experience in the software industry focusing on web technologies •Spoke and published widely at O'Reilly OSCON, Fluent, HTML5 Dev Conf, JavaOne, Google Developer Conference, Silicon Valley Code Camp and worldwide User Groups meetups •Doris received her Ph.D. from the University of California at Los Angeles (UCLA)
  • 3. Agenda 1.Angular vs Backbone 2.Demo: ToDoApp in Angular and Backbone 3.Mobile Apps for JavaScript 4.Demo: ToDoApp with Apache Cordova 5.Summary and Resources
  • 5. Angular vs Backbone: common •Client-side framework using the MV* design pattern •Solve the problem of Single Page Web Applications •Structure •Modular •Support multiple clients •Both open-sourced, under the permissive MIT license •Have the concept of views, events, data models and routing
  • 6. History Angular •Born in 2009 as a part of commercial product, called GetAngular •MiskoHevery, one of founders, turn a web application •17,000 lines in 6 months to 1,000 lines in 3 weeks using just GetAngular •Google starts sponsoring, becomes open-source Angular.js Backbone •Born in 2010, lightweight MVC framework/library •As a lean alternative to heavy, full-featured MVC (MVVC) frameworks such as ExtJS
  • 7. Learning curve and Flexibility Angular •Looks quite easy at first sight •After the very basics it is quite a steep learning curve from there •Highly opinionated •Fighting the framework if you don’t like the way it does certain things •Reading the documentation is not easy as a lot of Angular specific jargon •Lack of examples Backbone •Basic of backbone is very easy to learn •Not opinionated •most flexible framework with the less conventions and opinions •Need to make a lot of decisions when using Backbone •Need to watch or read a few tutorials to learn some best Backbone practices •probably need to learn another library on top of Backbone (e.g. Marionette or Thorax)
  • 8. Community Metric Angular Backbone Stars on GitHub 29.8k 19.3k Third-Party Modules 800 ngmodules 236 backplugs StackOverflowQuestions 49.5k 15.9k YouTube Results ~75k ~16k GitHub Contributors 928 230 Chrome Extension Users 150k 7k
  • 9. Angular Backbone Architecture MV* (Model View Whatever) MV + VC Template Support YES. doesn’t require any other separate template engine.(Also doesn’t support template engine) Uses underscore.js( an embedded template engine which allows logic inside template code) File Size 39.5K (no dependencies) 6.5K -43.5K (w/underscore& jQuery) Nested Template Support Yes No Data Binding Yes No Routing Yes Yes Compatible with other frameworks Yes Yes Additional Features Dependency Injection, Directives, Watch Expressions and 2-way Binding, HTML5 validations, Form Validations, and Filtering
  • 10. Angular: templates •Simply HTML with binding expressions baked-in •Binding expressions are surrounded by double curly braces <ul> <li ="framework in frameworks" title="{{framework.description}}"> {{framework.name}} </li> </ul>
  • 11. Backbone: templates <ul> <% _.each(frameworks, function(framework) { %> <li title="<%-framework.description%>"> <%-framework.name %> </li> <% }); %> </ul> Underscore is very basic and you usually have to throw JavaScript into the mix
  • 12. Angular: model •Angular does not use observable properties, no restriction on implementing model •No class to extend and no interface to comply •Free to use whatever you want (including existing Backbone models) •In practice, most developers use plain old JavaScript objects (POJO)
  • 13. Backbone: modelapp.TodoModel= Backbone.Model.extend({ defaults: { title: '', done: false, location: 'Getting your location...' }, toggleCompleted: function() { this.save({ done: !this.get('done') }); }, sync: function() { returnfalse; } });
  • 14. Backbone: modeland collectionvarTodoCollection= Backbone.Collection.extend({ model: app.TodoModel, }); app.todoCollection= newTodoCollection; •Backbone is built around observable properties, forcedto extend Backbone.Modeland Backbone.Collection •Backbone does not support observing functions, property needs to resetwhen any change happens
  • 15. Angular: good things •Two-way data bindings, dependency injection, easy-to-test code, extending the HTML dialect by using directives, out of the box filters, reusableservicesand factories •Minimizes drastically the boilerplate code, no direct DOM manipulation •The automatic Dirty Checking •No need getters and setters •modify property and angular automatically detects the change and notify all the watchers
  • 16. 2-way bindings and directives<divclass="templateWrapper"ng-repeat="toDoItemin todos"> <divclass="templateContainer"> <inputclass="templateTitle" ng-class="{crossedOut: toDoItem.done}"type="text" ng-text-change="changeToDoText(toDoItem)" ng-model="toDoItem.text"/> <h3class="templateAddress">{{toDoItem.address}}</h3> </div> </div>
  • 17. Dependency injection<sectionid="todoapp"ng-controller="ToDoCtrl"> <buttonclass="templateLefttemplateRemove" ng-click="removeToDo(toDoItem)"></button> </section> angular.module("xPlat.controllers") .controller('ToDoCtrl', ['$scope', 'maps', 'storage', function($scope, maps, storage) { $scope.removeToDo= function(toDoItem) { storage.del(toDoItem).then(function(todo) { varindex =$scope.todos.indexOf(todo); $scope.todos.splice(index, 1); }); } }]);
  • 18. Angular: more good things •Building application blocks into: Controllers, Directives, Factories, Filters, Services and Views (templates). •ViewsUI, Controllerslogic behind UI, Servicescommunication with backend and common functionality, Directivesreusable components and extendingHTMLby defining new elements, attributes and behaviors •Promisesplay a main role in Angular
  • 19. Custom directives<inputclass="templateTitle" ng-class="{crossedOut: toDoItem.done}"type="text" ng-text-change=" changeToDoText(toDoItem)" ng-model="toDoItem.text"/> angular.module('xPlat.directives') .directive('ngTextChange', function() { return{ restrict: 'A', replace: 'ngModel', link: function(scope, element, attr) { element.on('change', function() { scope.$apply(function() { scope.$eval(attr.ngTextChange); }); … });
  • 20. Custom directives, continued$scope.changeToDoText= function(toDoItem) { //Notice .then Promisepattern is used heregetAddress().then(function(address) { toDoItem.address= address; returnstorage.update(toDoItem); }, function(errorMessage) { toDoItem.address= errorMessage; returnstorage.update(toDoItem); }); }
  • 21. Angular: bad things •Extremely opinionated •Frustrated: prior experience in creating UI with Javascriptis rendered almost useless •Do everything according to the “Angular way” •Directives could be super complicated and odd •Expression language too powerful •<buttonng-click="(oldPassword&& checkComplexity(newPassword) && oldPassword!= newPassword) ? (changePassword(oldPassword, newPassword) && (oldPassword=(newPassword=''))) : (errorMessage='Please input a new password matching the following requirements: ' + passwordRequirements)">Click me</button>
  • 22. Backbone: good things •Compact, minimal, not opinionated •Resembles classic Javascriptthe most •Has the least learning curve •Huge community (ecosystem) and lots of solutions on StackOverflow •Many popular applications •Twitter, Foursquare, LinkedIn Mobile, Soundcloud, Pitchfork, Pandora, Pinterest, Flixster, AirBNB
  • 23. Backbone: bad things •Hands off: Needto develop own •Application Architecture / Layout Structure / Memory management/ •Too much option of bringing third party plugins •Cost time to do research, it’s not so minimal and becomes opinionated •Lacking features compared to the newer frameworks •No data binding •a lot of boiler plate code to make it work well •doesn’t allow easy iteration through UI variants •No nested model •userModel.get("name").first = "Tom"; userModel.set("name.first","Tom"); --can’t do •Views manipulate the DOM directly, making them really hard to unit- test, more fragile and less reusable.
  • 24. Backbone vs AngularupdateCrossOut: function() { if(this.model.get('done')) { this.$input.addClass('crossedOut'); … … } else{ this.$input.removeClass('crossedOut'); … … }}, <inputclass="templateTitle" ng-class="{crossedOut: toDoItem.done}"… ng-model="toDoItem.text"/>
  • 25. Performance Comparison: TodoMVCBenchmark •Angular (v1.2.14), Backbone (v1.1.2) + jQuery (v2.1.0) •Test case: •Add 100 todos, toggle them one by one, then delete them one by one, •10 runs average •Data collected on an Late 2013 Retina MacbookPro 13 with a 2.6GHz dual-core i5-4288U Processor under OS X Mavericks 10.9.1. •Average Response on Chrome 33, Firefox 28 and Safari 7 •AngularJS1617.72ms •Backbone833.36ms •http://vuejs.org/perf/
  • 26. Demo ToDoMVC in Angular and Backbone
  • 27. When to use Angular? •Something declarative that uses View to derive behavior •Custom HTML tags and components that specify your application intentions •Easily testable, URL management (routing) and a separation of concerns through a variation of MVC •Good at making quick changes •create easily testable code and test it often •Not a good fit for Angular •Games and GUI editors are examples of applications with intensive and tricky DOM manipulation, different from CRUD apps •may be better to use a library like jQuery •Has its own scaffolding tools available (angular-seed)
  • 28. When to use Backbone? •Something flexible, offers a minimalist solution •Support a persistence layer and RESTfulsync, models, views (with controllers), event-driven communication, templatingand routing •Imperative, update View when model changes •Like some decisions about the architecture left to you •Building something complex, •Active extension community Marionette62, Chaplin63, Aura64, Thorax65 •Scaffolding tools (grunt-bbb66, brunch67)
  • 29. Go mobile From web app to hybrid app
  • 30. Apps dominate the mobile web
  • 31. Low investment for more capabilities Capabilities Developer Investment Web App Hybrid App Native App
  • 32. World Wide Web Hybrid Deliverymechanism Delivered via browser Packagedon my device Input Touch Touch Offline Support No Yes DeviceCapabilities Web APIs Only Native Device APIs Monetization Web Commerce App Store & In-App Purchases Discoverability Bookmarks & Search Engines Always on my home screen 
  • 33. What is Apache Cordova? •Open-source framework
  • 34. Native Wrapper What is Apache Cordova? •Open-source framework •Hosted webview •Single, shared codebase deployed to all targets <webview> Your JavaScript App
  • 35. Native Wrapper What is Apache Cordova? •Open-source framework •Hosted webview •Single, shared codebase deployed to all targets •Plugins provide a common JavaScript API to access device capabilities <webview> Your JavaScript App Cordova Plugin JS API
  • 36. Native Wrapper What is Apache Cordova? •Open-source framework •Hosted webview •Single, shared codebase deployed to all targets •Plugins provide a common JavaScript API to access device capabilities •About 6% of apps in stores (13% in enterprise) <webview> Your JavaScript App Cordova Plugin JS API
  • 37. Demo Converting ToDoMVC into a hybrid app
  • 38. Tips, Tricks & Considerations •Use Cordova when an idea makes sense as a web app, but you need… •Cross-platform support as a packaged application •Offline support •Access to native device capabilities (e.g. camera, accelerometer, file system) •Better reach & discoverability •If you’re building a first-person shooter… go native. •Cordova depends on the platform build system •To build for iOS, you need a Mac •To build for Windows 8+, you need Windows 8+ •To build for Android, you need the Android SDK •Touch input means bigger everything. Consider a control framework like Ionic.
  • 39. Summary •Backbone was easier to learn compared to Angular •Backbone tends to be faster than Angular in ToDoMVCperftests •Angular resulted in fewer lines code than Backbone for our app making it easier to maintain •Angular provided far more features (e.g. data-binding, custom directives, declarative markup) •Converting both frameworks to mobile was equally simple via Apache Cordova
  • 40. Resources •AngularJS: http://angularjs.org •BackboneJS:http://backbonejs.org •ToDoMVC: http://todomvc.com •Tools for Apache Cordova: http://aka.ms/cordova •StackOverflow#multi-device-hybrid-apps