What is AngularJS?
AngularJS makes it easier to develop a modern single-page application (Spas:single page applications).
- AngularJS binds application data to HTML elements.
- AngularJS can clone and repeat HTML elements.
- AngularJS can hide and display HTML elements.
- AngularJS can add code to the HTML element "behind".
- AngularJS supports input validation.
code Example:
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "Utf-8">5 <Scriptsrc= "Http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></Script>6 </Head>7 <Body>8 9 <DivNg-app="">Ten <P>Name:<inputtype= "text"Ng-model= "Name"></P> One <H1>Hello {{Name}}</H1> A </Div> - - </Body> the </HTML>View Code
When the page is loaded, AngularJS automatically opens.
The ng-app directive tells the angularjs,<div> element to be the "owner" of the AngularJS application .
The ng-model directive binds the value of the input field to the application variable name.
The ng-bind directive binds the application variable name to the InnerHTML of a paragraph.
ANGULARJS Study Notes