framework embodies some abstract design, with more behavior built in. In order to use it you need to insert your behavior into various places in the framework either by subclassing or by plugging in your own classes. The framework's code then calls your code at these points. Library A library is essentially a set of functions that you can call, these days usually organized into classes. Each call does some work and returns control to the client. 3
structural framework for dynamic web apps, • data binding and dependency injection eliminate much of the code you would otherwise have to write, • browsers compatibility abstract layer • a complete client-side solution (handles DOM, handes AJAX calls) • Everything you need to build a CRUD app in a cohesive set: Data-binding, basic templating directives, form validation, routing, deep-linking, reusable components and dependency injection. • Testability story: Unit-testing, end-to-end testing, mocks and test harnesses. • Seed application with directory layout and test scripts as a starting point.
• Angular simplifies application development by presenting a higher level of abstraction to the developer. • Like any abstraction, it comes at a cost of flexibility. In other words, not every app is a good fit for Angular. • Angular was built with the CRUD application in mind. • Games and GUI editors are examples of applications with intensive and tricky DOM manipulation ... are probably not a good fit for Angular.
platform • Progressive web apps • Native • Desktop • Speed and performande • Code generation optimalized for JS vms • Server side rendering • SEO • Split loading modules/components because of new Component Router • Angular CLI • New standards • Web components friendly • Standarized from day 1 – style guides, TypeScript on all examples • Explicit components lifecycle • Runtime • HTML centric templates
of the box So • Large size, but less external components to develop min app React • Library • Lot of features provided by external packages So • Choose components and code blocks by your own and handle/deal with it by your own 12
Reduced Reduced High Tooling Low High High Code Design JS into HTML JS into HTML JavaScript Centric JavaScript “Fatigue” Less Less More Attribute AngularJS Angular 2 React Churn Reduced Reduced High Tooling Low High High Code Design JS into HTML JS into HTML JavaScript Centric JavaScript “Fatigue” Less Less More *by Reddit and HackerNews
by evolution • HTML centric for templating • (view) Fails at runtime React • High chorn • Developed by revolutions • JavaScript centric for templating • (view) Fails at compilation time 14
Attribute AngularJS Angular 2 React DOM Regular DOM Regular DOM Virtual DOM Learning Curve High Medium Low Packaging Weak Medium Strong Abstraction Weak Strong Strong Debugging General Good HTML / Bad JS Good JS/Good HTML Good JS / Bad HTML Fails When? Runtime Runtime Compile-Time Binding 2 Way 2 Way Uni-Directional Templating In HTML In TypeScript Files In JSX Files Component Model Weak Strong Medium Building Mobile? Ionic Framework Ionic Framework React Native MVC Yes Yes View Layer Only Rendering Client Side Server Side Server Side
your using components • When handling forms and not a lot of rich-communicative UI • When not handling large amount of data (digest loop is sensitive for large, nested objects) Not recommended • Games • All apps with complex DOM manipulations needed
your using components • When handling forms and not a lot of rich-communicative UI • When not handling large amount of data (digest loop is sensitive for large, nested objects) Not recommended • Games • All apps with complex DOM manipulations needed
control matters • When handling complex models or creating a lot of DOM • Lot of client-side communication • "building large applications with data that changes over time." Not recommended /Not need for • CRUD data-bound REST apps • Static pages, pages that need templating • Form-driven apps
manipulations • Isolated forms validation • Isolated AJAX calls Not recommended • Building SPA • Logic based on DOM elements • Building dynamic forms *You might not need jQuery