Mastering Web Application

(Rick Simeone) #1
Chapter 12

Given that the current AngularJS doesn't support on-the-fly loading of
application's code, cumbersome setup steps and debatable performance
gains we would advise against using asynchronous loaders (Require.js
and similar) in AngularJS 1.1.x applications.

Supported browsers


The AngularJS source code is rigorously tested on a continuous integration (CI)
server. Each code change in the framework triggers a comprehensive battery of unit
tests. No code can make it into the framework code base, unless it is accompanied by
a corresponding unit test. This strict approach to unit testing assures stability of the
framework and its long-term, smooth evolution.


The CI server executes at the time of writing, over 2000 individual tests on different
browsers: latest versions of Chrome, Firefox, Safari, and Opera, as well as Internet
Explorer version 8, 9, and 10. The number of tests and a list of browsers used for
testing should give a good idea of the framework's maturity and solidity. AngularJS
is guaranteed to work on the browsers listed here. It is very likely that it also works
on other modern browsers not enumerated here (mobile browsers come to mind).


Working with Internet Explorer


It shouldn't come as a surprise that there are certain particularities when it comes
to Internet Explorer support. While IE9 and IE10 should work out-of-the-box,
supporting IE8 needs special attention.


Normally one would bootstrap an AngularJS application by using the ng-
app="application_name" directive. Unfortunately, it is not enough for IE8 and we
need to add another attribute: id="ng-app".


IE8 won't recognize custom HTML tags if additional steps are not taken. For
example, we can't include templates similar to the following one, until we teach IE8
to recognize the custom tag:


<ng-include="'myInclude.tpl.html'"></ng-include>

We can do so by creating custom DOM elements first, as shown in the following
code snippet:


<head>
<!--[if lte IE 8]>
<script>
document.createElement('ng-include');
Free download pdf