Lets Learn AngularJS 1 - Introduction

In this series we will start on learning AngularJS mainly to be used in the Umbraco CMS. I will start by introducing what is AngularJS and why is it better compared to other JavaScript frameworks.


AngularJS is a JavaScript framework that helps build web applications

Advantages of AngularJS

Building AngularJS

In order to build AngularJS applications, all we need is a angular.js file which can be downloaded from here.

Linking AngularJS

In order start building an AngularJS application, we need to link it to our html page. To do this, we need two things.

Note that I am using the minified version. You can use whichever you want.

<script src="angular.min.js"></script>

Secondly, we need to add “ng-app” attribute to somewhere in the html. I will include it to the body element. “ng-app” is called a directive and whole list of attributes can be found at the AngularJS page.

Now let’s build an AngularJS application to multiple 5 and 3.

<!doctype html>
    <script src="angular.min.js"></script>
<body ng-app>
        5 * 3 = {{ 5 * 3 }} 

Note that double curly brackets allows us to specify an expression in AngularJS.