Mastering Web Application

(Rick Simeone) #1
Chapter 1


  • Declarative approach to the UI results in a very concise and expressive way

  • The excellent UI templating machinery doesn't put any constraints on the
    JavaScript code (for example, models and controllers can be created using
    plain, old JavaScript without the AngularJS APIs called all over the place)


AngularJS is breaking new ground by bringing solid testing practices into the
JavaScript world. The framework itself is thoroughly tested (practice what you
preach!), but the whole testability story doesn't stop here, the whole framework
and the ecosystem around it were built with the testability in mind. It continues
as follows:



  • The dependency injection engine enables testability, since the whole
    application can be composed from smaller, well tested services.

  • Most of the code examples in the AngularJS documentation have got an
    accompanying test, it is the best proof that code written for AngularJS is
    indeed testable!

  • The AngularJS team created an excellent JavaScript test runner called
    Testacular (spectacular test runner!). Testacular turns an overall testing
    workflow into a joyful experience, which is useful, fast, and reliable. Testing
    is not always easy, so it is important to have tools that assist us instead of
    getting in a way


Above all, AngularJS makes the web development fun again! It takes care of so
many low-level details that the application's code is extremely concise of. It is not
uncommon to hear that rewriting an application in AngularJS reduces the overall
code base by a factor of five or even more. Of course everything depends on an
application and a team, but AngularJS lets us move fast and produce results in the
blink of an eye.


jQuery and AngularJS


AngularJS and jQuery form an interesting relationship that needs special
mentioning. To start with, AngularJS embeds, as part of its sources, a simplified
version of jQuery, that is, jqLite. This is really a tiny subset of the complete jQuery
functionality that focuses on the DOM manipulation routines.


By embedding jqLite, AngularJS can work with no dependency on any
external library.
Free download pdf