How to setup AngularJS? - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
How to setup AngularJS? in AngularJS

How to setup AngularJS?

How to setup AngularJS? 

To setup AngularJS in the web page, first we need to refer the AngularJS library. To do this, go to the official website of AngularJS and download the .js file - https://angularjs.org/.
Now add the reference of AngularJS library in the web page.
<!DOCTYPE html>
<html ng-app>
<head>
<title>AngularJS</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
</head>
<body>
Hello world.
<p>The sum of 2 and 1 is equal to <b>{{ 2 + 1 }}</b></p>
</body>
</html>
Notice the highlighted code in the above code snippet.
  • The <html> tag has ng-app attribute that is used to bootstrap the AngularJS, this is the first and most important directive that denotes that AngularJS is going to controll this and all its children elements. This attribute can be applied to <html>, <body>, </div> or any other valid HTML element. It always good to add this attribute to the <html> or <body> element so that entire web page elements will be avialable to AngularJS to control.
     
  • The <script> tag simply refers the AngularJS library from Google CDN
     
  • The {{ 2 + 1 }} is an expression that is validated by AngularJS. This is the example of one way binding and it is done by wrapping the code in {{ and }} characters. If the expression contains variables, it keeps the User interface up to date when the variable value changes.


About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.