Monday, January 12, 2015

Lession 1: Including the Angular.js Library & Code in an HTML Page

Angular.js is a structured javaScript framework, for dynamic  web applications. Angular is best MVC framework for SPAs(Single Page Applications). Angular's key features are 3Ds:
  • Directives
  • Dependency Injectors
  • Data Binding
Lets learn about these thing.. How to include angularJs in your webpage is explained below:
<!doctype html>
<html lang="en" ng-app>
<head>
<meta charset="utf-8">
<title>My HTML File</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js"></script>
</head>
<body>
Some Text
</body>
</html>
Here there are two thing you need to consider. 1) Attach a angularJs CDN link
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js"></script>
2) Bootstrapping the application by adding "ng-app", andgularJs containment will start from where "ng-app" mentioned.
<html lang="en" ng-app>
Done! You can now start writing you code..

No comments:

Post a Comment