Complexity kills innovation.
State of the web makes users happy but not developers
Jquery is still imperative: you express how to do and not what to do
Angular is a declarative way: with declarative templating you just link things and magic happen. Changes to the model will be propagated to the view and at the end Dom updates are done automatically. So you don't work on the views updating fields but on the model.
Data binding
. Bind model to templates and let templates to generate the views
. Two ways data bindings
Advanced templates binding collections with repeat hint
. Remove code to synchronize model and views through 2 ways data binding
. New spec coming to allow data binding on browsers and not in frameworks
HTML can be verbose
. Custom elements in form of reusable components (angular directives)
. New spec web components with native API (available in chrome code based)
Http://Buildwith.angularjs.org
WebStorm is a great javascript IDE
Scope is the glue between the view and the model, a sort of view model.
Angular filters for making conversions of data (from name to avatar URL)
Ng-model makes the 2 ways binding happening
Using mongolab which is a mongo db on the cloud (with rest API). Backend calls are asynchronous and not blocking (it would be bad on a single threaded environment like a javascript app). The API looks synchronous...
No global state on angular apps. Global state is bad and not testable. Angular use dependency injection instead.
Angular apps are testable because
. Separation of duties
. Dependency injection
. Guideline: no Dom manipulation on controllers (easy to test controllers because don't need a Dom)
. Using jasmine, extended with dependency injection (don't even need to write index.html.... There is a spectacular test runner. Spectacular runs on node and use plain browsers. It watch code and fire tests automatically on change)
. Mock-out server calls using dependency injection
Angular makes browser smarter and makes developers happy, productive and innovative. Really great!
Ah, back button just work on angular apps (routers)!
No comments:
Post a Comment