Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Mvvm knockout vs angular

51,609 views

Published on

A presentation I gave at ALT.NET Melbourne on February 26 2013 : http://www.basarat.com/2013/03/knockout-vs-angularjs-mvvm-frameworks.html

  • Sex in your area is here: ❤❤❤ http://bit.ly/2F90ZZC ❤❤❤
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating direct: ❶❶❶ http://bit.ly/2F90ZZC ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • accessibility Books Library allowing access to top content, including thousands of title from favorite author, plus the ability to read or download a huge selection of books for your pc or smartphone within minutes ,Download or read Ebooks here ... ......................................................................................................................... Download FULL PDF EBOOK here { http://bit.ly/2m6jJ5M }
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Mvvm knockout vs angular

  1. 1. MVVM for the Web Angular vs. Knockout VS. @basarat
  2. 2. Why MVVM?• Cleaner user interface • (used to be Cleaner code only)• Designer / Developer separation
  3. 3. What makes MVVM Work?• Two way DataBinding for properties • With some form of interception options• Command binding• Templates• Names change but concepts remain the same.
  4. 4. MVVM the Knockout Way
  5. 5. How MVVM works for XAML• INotifyPropertyChanged (INPC)• ICommand Interface and Command Property• DataTemplates / ItemTemplates
  6. 6. Enter Knockoutjs• By Steve Sanderson. • Works at microsoft.• Highly inspired and directed by what was already there in XAML world. • Perhaps to ease XAML people into HTML.
  7. 7. Knockout ViewModel similar to INPCko.obervableko.computedko.obervableArray
  8. 8. Knockout INPC View• XAML View (dependency properties):• Knockout View (bindings):
  9. 9. Knockout Commands• XAML• Knockout (click and other bindings)
  10. 10. Knockout DataTemplates• XAML• knockout
  11. 11. Knockout uses concept of Bindings
  12. 12. Angular js?
  13. 13. MVVM with AngularJS : Observables• Don’t need them. Means your objects do not need an INPC type of implementation.• “KO dependency tracking is a clever feature for a problem which angular does not have” – heard on StackOverflow
  14. 14. How does it know if anything changed?• Angular remembers the value and compares it to previous value.• This is basic dirty checking. If there is a change in value, then it fires the change event.• To know when angular should check the new value it we have scope.
  15. 15. Quick AngularJS tutorial• http://jsfiddle.net/basarat/V9sYB/
  16. 16. Why Angular chose a different method?• Better syntax, especially for templates • Google plans to make it a web standard so browsers can do this natively.• Change listeners fire immediately on setter, which is a problem, since the change listener can further change data, which fires more change events.
  17. 17. Quick AngularJS tutorial 2• How browsers could support it natively
  18. 18. Angular js performance• Humans are • Slow – anything faster than 50ms is imperceptible • Limited - cant really show more than about 2000 pieces of information to a human• Can you do 2000 comparisons in 50 ms even on slow browsers? That means that you have 25us per comparison.
  19. 19. MVVM the Angular Way
  20. 20. Observables : ViewModel• https://github.com/basarat/ChessClock• Standard javascript properties your scope• Really good with Typescript• Angular folks call their framework MV* i.e. • Model View Whatever• But like to name it Controller
  21. 21. Observables : The view• {{property}} syntax
  22. 22. Filters• Similar to XAML IValueConverter but One way binding for display
  23. 23. Commands• The VM• The View
  24. 24. Templates
  25. 25. Angular JS uses concept of directives
  26. 26. Which one should you use?Performance
  27. 27. jsPrefhttp://jsperf.com/angularjs-vs-knockoutjs
  28. 28. Which one should you use?Browser Support
  29. 29. Angular• http://docs.angularjs.org/misc/faq • We run our extensive test suite against the following browsers: Safari, Chrome, Firefox, Opera, IE8, IE9 and mobile browsers (Android, Chrome Mobile, iOS Safari)• Yahoo’s Class A browser
  30. 30. Knockout• http://knockoutjs.com/documentation/browser- support.html • Mozilla Firefox 2.0+ (latest version tested = 3.6.8) • Google Chrome (tested on version 5 for Windows and Mac; should work on older versions too) • Microsoft Internet Explorer 6, 7, 8, 9, 10 • Apple Safari (tested on Windows Safari version 5, Mac OS X Safari version 3.1.2, and iPhone Safari for iOS 4; should work on newer/older versions too) • Opera 10 for Windows• Knockout was also found to work on the following browsers (though we don’t recheck these for every release): • Opera Mini • Google Android OS browser (OS version 2.2)
  31. 31. Which one should you use?Popularity Contest
  32. 32. Knockout vs. Angular• Google Searches• StackOverflow tags ( as of feb 2013) • Knockout : 4,304 • Angular : 2,794
  33. 33. Decisive• Stared on Github (as of feb 2013) • https://github.com/angular/angular.js : 7072 • https://github.com/SteveSanderson/knockout : 3011
  34. 34. Which one should you use?Debugging
  35. 35. Batarang• Dedicated Debugging tool for angular.• None for knockout as of yet.
  36. 36. ConclusionThe world really needs both
  37. 37. Choice (my opinion)• Performance : Angular• Legacy Browser (specifically IE) : Knockout• MS bubble : Knockout• Popularity : Angular• Debugging : Angular• Awesomest Web App Ever : Angular
  38. 38. Links• Help Knockout • http://knockoutjs.com/documentation/introduction.html• Help Angular • http://docs.angularjs.org/guide/concepts • https://github.com/angular/angular.js/wiki/JsFiddle-Examples• Comparisons • http://stackoverflow.com/questions/9682092/databinding-in- angularjs • http://litebyte.net/blog/?p=135 • TODO App in both: http://addyosmani.github.com/todomvc/
  39. 39. Thank you• http://basarat.com• basaratali@gmail.com• @basarat

×