• Previous: Amazon (web services), Ning, Startup(1..N) • Current: SunnyCloud • Short Story: A-Team you can call on to build (and rescue) cloud services, web & mobile applications • Longer Story: Network of developers aiming to change the way businesses build applications
re: AngularJS 2.0 • for good reason, it looks scary • actually, it is scary • *but* the changes are well-thought-out • so, let’s recap what we know in AngularJS 1.x, take a deep breath and get ready for AngularJS 2.0
1.x in 2012 • The world looks like “Directives” • The “Application” is like a mammoth directive • Application has Routes, Controllers, Templates • Everything lives in a complex hierarchy of Scopes • Controllers manage the scope that gets sent to the view (template)
behavior to a DOM element/attribute • Extremely powerful & concise way to create an application within HTML DOM • Bridge older-style JS (jQuery and other UI components) to newer component style • Directives are *really really* hard to understand: syntax, transclusion, parent scopes, event model http://www.pseudobry.com/building-large-apps-with-angular-js/
services, controllers, directives, routes, and more • The $rootScope of all evil : all scopes chain from $rootScope • Depends on all declarations being in-scope (loaded into JS) http://weblogs.asp.net/dwahlin/using-an-angularjs-factory-to-interact-with-a-restful-service
• Makes it so that most of the view stays in the HTML DOM • Allows for nice, dynamically-loaded template fragments (as well as template strings if desired) • Managing templates is tricky because the controller scope creeps into the view (data, functions)
scope for the view • Contain data + operations + logic • AngularJS 1.x style guides advocate slim controllers, reusable logic and long-lived data in Services • ControllerAs syntax makes scope much more explicit • Managing state & communication between controllers is *really* tricky
names of params and params • Events and event model • Learning curve for directives (and everything else) • Digest cycle: $scope.$apply(), $timeout, $watch • Modularity • Expressions vs. objects vs. values in core directives (ng-disabled, ng-if, ng-src, ng-class) • Server-side generation / SEO optimization
frameworks • Evolution of Backbone.js, Ember.js, Knockout, React/Flux, Polymer • HTML5 & evergreen browsers became the norm • IE market share went from 60% to 19%, Chrome from 3% to 48%, Firefox from 31% to 16%, Mobile from 1% to 32% • “JS Framework Trainer/Consultant” became a lucrative career choice
standard • Stronger templating - ability to have logic in templates • Routing/History • Events - publish/subscribe • Models, Data Binding, & computed properties • Pre-populating deep views within single-page apps • Addons & Project model w/ Ember CLI
Components from first principles • Strong encapsulation using Services • Growing library of Material Design elements (immediately useful on mobile) • Extensive supply of Polyfills • Shadow DOM
for ng directives • Square brackets for properties • Work in progress… http://victorsavkin.com/post/108837493941/better-support-for-functional-programming-in https://angular.io/docs/js/latest/guide/user-input.html
series is stable • Version 1.5.0 in beta • Still a large installed & developer base • Still a major target for frameworks like Ionic, plus other PaaS services like PubNub and Firebase
thinking in a more component-oriented way • Learn TypeScript, adopt the new tooling for command-line & IDE’s • Accept the new syntax around bindings & events that allow IDE support • Be patient as new components arrive (similar to how directives proliferated in 1.x) • Adjust to life without controllers, scope inheritance, $apply • Embrace functional programming & immutable data
shaping up to be a much cleaner version of AngularJS 1.x - the concepts are much crisper • For AngularJS 1.x developers, there will be many, many annoyances in the migration from 1.x to 2.x • The end result will be cleaner code, more well-encapsulated and more performant • AngularJS 2.0 is more similar to framework peers (Ember, Polymer) than 1.x was to its peers • It’s possible to embrace style guidelines now to help make the migration easier • A draft 2.0 migration upgrade guide is available as well