Introduction of AngularJS
AngularJS is a javascript based MVC framework for developing single page web applications. AngularJS developed and maintaining by the Google.
Installing AngularJS into HTML page
There are different ways to install AngularJS into HTML page. We can use CDN link of AngularJS page with script tag in header or body tag of the HTML page
By using CDN link
Following is the CDN script link to add before closing body tag in html page
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
Creating first AngularJS program
To tell the AngularJS we must use ng-app directive with body tag as an attribute by specifying app name.
<body ng-app="cookiestore_app">
Steps to wrtite hellow world program in AngularJS
Following are the steps to create AngularJS application
Create empty HTML page
Add AngularJS script t HTML page with Script tag
Add ng-app to html element or body element of the HTML page, here we need to provide name of the application as a value to the ng-app directive.
Initiaize AngularJS by calling module() funtion
With the directive ng-controller add a controller directive to the part of HTML view page
Set the values for scope object , and use these values by using AngularJS expression or ng-bind or ng-model directive in HTML view block.
Post a Comment
Post a Comment