Search within TutorialsPark

AngularJS Download and Setup


Learn how to use Download and Setup AngularJS Framework on your Device.


AngularJS : Downloading AngularJS and Setting up

Downloading and Installing AngularJS is extremely easy and takes no time or money.Its open source and hence available free from their website angularjs.org

Create a new folder to store the AngularJS JavaScript Files, and use the <script> element to link the files on the document.

You can also serve AngularJS files using a Content Distribution Newtwork (CDN) , instead of having the files on the local server.


AngularJS : Installing AngularJS using CDN

To use the Content Distribution Network(CDN) you simply need to put the following script in the <head> element

The latest stable version at the time of writing this is version 1.3x(stable)

The advantage of using Content Delivery Networks is that they provide good speed and performance, and are bandwidth friendly. AngularJS files are hosted for free on large Web Organisations like Google, Microsoft , Yahoo etc.

Syntax: AngularJS files Hosted on Google CDN


AngularJS : Installing AngularJS on your Server

Go to the website angularjs.org and click on Download button which appears right in the front page.Click on that you will see a Dialog Box like below.

Downloading Angular JS

To choose a minified version, select 1.3.x(legacy) for the branch option and the Minified for the build option.

When the Download is completed move the .js files into the angularJS folder

There you go, you have downloaded and installed.


AngularJS : Browser Support

AngularJS has support on all Major Web browser like Safari , Chrome , FireFox and Opera etc.

If possible try using Google Chrome which comes from the parent company of AngularJS. The reason being that chrome is a well built browser and conforms to latest stable W3C standards, and great developer support using Key F12

Google Chrome also provides an extension providing support for AngularJS to the F12 tools, its called as Batarang AngularJS, though not a perfect tool but surely useable.

AngularJS : Browser Support

Example: Javascript Conditionals - if

Give it a TRY! » Note: If there is only statement after the conditional expression, then the curly braces are optional.


Javascript Conditionals: else

The Javascript condition else is used to create a branching construct which allows a two way decision.

If the condition within the if expression is evaluated as false, then the code block within the else part is executed.

Syntax: Javascript Conditional - else

Example: Javascript Conditional - else

Give it a TRY! » Note: The else statement must always be used after an if expression


Javascript Conditionals: if/else if

The Javascript branching construct if/ else if is used to create a multidecision structure.

If the first if is evaluated as true, then the code block within it is executed. Or else, the following if else conditions are evaluated and if found true, the code block within it get executed.

Syntax: Javascript if else/if

Example: Javascript if else/if

Give it a TRY! » Note: The final else serves as the default action, incase all other conditions are false.


Javascript Conditionals: Switch Statement

Javascript switch statement is used as an alternative to if / else if statement, it makes the program more neat and readable while dealing with multiple branching construct.

How does a switch Statement Works?

1. The value of the switch expression is evaluated once in the beginning

2. This switch expression value is then matched against the expressions, called as labels following the keyword case

3. If switch condition is satisfied by any of the cases , then the code block within that case is executed.

4. If none of the cases are matched then the control drops to the default case.

Here , the break statement is used to terminate the program if any of the case satisfies the condition, if omitted then all the cases are matched

Syntax: Javascript switch

Example: Javascript Conditionals Switch

Give it a TRY! »


Javascript Switch : Default Case using Fall Through

Javascript switch enables users to have same output for multiple cases, this is achieved using a fall-through to a common default

If you need a case statement to fall through, do not use the break for that particular case.

Example: Javascript Switch - Fall-Through

Give it a TRY! » Note: As a good development practise, include a comment denoting that the omission of break statement is intentional.