Learning about AngularJS

Last Saturday I got the chance to go and hear Misko Hevery talking about AngularJS. Misko, who works at Google, is the creator of the framework and, while staying in his holidays in Barcelona, he was very keen to spend some time with us and introduce AngularJS to all the GDG Barcelona.

I’m going to write down some bits of information I gathered from the talk.

  • Nowadays users are happy with browsers, but developers has to put to much effort to make everything working in all versions of all browsers. Complexity kills!
  • We should have reusable components. We all copy & paste way too much code from sites like Twitter Bootstrap or any particular jQuery plugin.
  • Data binding is the link between the model and the view. Whenever model gets updated, changes are automagically propagated to the view.
  • AngularJS tries to make the web developing a process like it’s going to be in the future. It implements features that Misko suggested are going to be implemented into the future browsers.
  • The framework has been designed to be testable and has a great documentation that covers how to setup tests for you Javascript (using any test library).

If you visit the site and check the introductory videos you will get the idea pretty fast, but I wanted to put this snippet that illustrates very well how it works:

&lt;!doctype html&gt;<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>

Hello {{yourName}}!

So, as you can see in the example, it implements a lot of nice features but one of the more interesting is the Data Binding. You can bind the content of the input with the {{ variable }}. I haven’t play too much yet, but it looks really interesting. Definitely, Misko looks like he knows what he is doing, so let’s see how it evolves.