AngularJS
AngularJs is a JavaScript-based open source front-end web
application framework mainly maintained by Google. The JavaScript components
complement Apache Cordova, the framework used for developing cross-platform
mobile apps.
The AngularJS framework works by first reading the HTML page,
which has embedded into it additional custom tag attributes. Angular interprets
those attributes as directives to bind input or output parts of the page to a
model that is represented by standard JavaScript variables. The values of
retrieved from static or dynamic JSON resources.
AngularJS Exteds HTML with ng-directives.
The ng-app directive defines an AngularJS application.
The ng-model directive binds the value of HTML controls to
application data.
The ng-bind directive binds application data to the HTML
view.
AngularJS Expressions
AngularJS expressions are written inside double braces: {{
expression }}
AngularJS will “output” data exactly where the expression is
written
Example:
<!DOCTYPE html>
<html>
<scriptsrc="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<html>
<scriptsrc="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="">
<p>expression: {{ 2+2 }}</p>
</div>
<p>expression: {{ 2+2 }}</p>
</div>
</body>
</html>
</html>
AngularJS Applications
AngularJS modules define AngularJS applications.
AngularJS controllers control AngularJS Napplications.
The ng-appp directive defines the application, the ng-controller directive defines the controller.
Comments
Post a Comment