I’ve been aware of AngularJS for some time, a talk by Craig Norton at Agile Yorkshire peaked my interest but I’m ashamed to say that I’ve never invested the time to look into it. A few comments colleagues and blogs have made about breaking changes in V2 have put me off somewhat, is Angular turning into another Silverlight?
We’ve been developing an in house DevPortal at work and a colleague of mine was very keen to use Angular and Bootstrap to investigate their value in bringing into our core product.
Over the past few weeks I’ve been feeling somewhat left behind, unable to contribute to some exciting process changes because I wasn’t up to speed with the technology. Not being familiar (or particularly liking) my lack of understanding and knowing how it feels to be the only evangelist on a team I’ve invested a little time this weekend to try and understand the basics of Angular.
With the help of PluralSight I’ve started covering the basics, I’m not very far through yet but can already remember what intrigued me at Craig’s talk. This is HTML and Javascript, but built in a powerful framework you’d expect from a .NET application.
This is the Hello World of AngularJS, we create a module and a controller and bind the value of the helloMessage to the variable defined in $scope.
<!doctype html> <html ng-app="app"> <head> </head> <body> <h1 ng-controller="HelloWorldCtrl">{{helloMessage}}</h1> <script src="https://code.angularjs.org/1.4.0/angular.js"></script> <script type="text/javascript"> angular.module('app', []).controller('HelloWorldCtrl', function ($scope) { $scope.helloMessage = "Hello World"; }) </script> </body> </html>
I’m looking forward to seeing what’s in the second module!