Why you should use AngularJS for your Phonegap Applications

There are tons of heavy hitting javascript frameworks / libraries out there that seek to make javascript more managable, dependable, and let developers approach the language as more than just a quick fix language. There are libraries like jQuery, Zepto, and backbone, which simplify tasks like DOM manipulation, JAX, and many other standard tasks. These libraries aren’t really desirable for a large scale all javascript application because they don’t enforce any type of pattern. This is where frameworks like EmberJS, AngularJS, ExtJS step in. These frameworks enforce the MVC pattern and make your application much cleaner to develop. Why should you pick Angular over another framework like Ember or Ext?

It’s free

and it is made by Google, so it will probably always remain free. I only point this out because ExtJS’s latest build isn’t free.

Declarative HTML

I love that HTML can be used to express events, bindings, etc. Some critics of Angular have said that this is not good because it mucks up production HTML code and user’s can see it. That isn’t an issue for a Phonegap app because your code is not exposed to the user! Going with this fact, I think that the declarative HTML will help separate concerns between event / data binding and the actual events / data. This is in contrast to a framework like jQuery where the event binding and events are comingled.

Speed

Angular does pretty well in the speed department, as you can see here. This is important on phones which do not have the performance of your browser on your computer.

Ember is a really solid framework as well, doing things like data binding, views, etc which libraries like jQuery don’t. Each will help improve your application’s code organization and lead to a more solid and inviting application, there are just a few points with Angular which make it more desirable, to me, on a Phonegap application. I’ll be exploring a basic Angular application which will use liquid lab’s google tasks on Phonegap tutorial, but applying it to Angular instead of jQuery mobile.