The problem with HTML is that it works well when declaring static documents but not so well when declaring dynamic views in web-applications.
AngularJS is a solution to this, it’s a JavaScript framework, and a library written in JavaScript, version 1.0 was released in 2012.
Angular models are plain old JavaScript objects.
AngularJS can be added to an HTML page with a <script> tag, such as:
<script src=”http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js“></script>
AngularJS extends HTML attributes with Directives, and binds data to HTML with Expressions.
AngularJS directives are HTML attributes with an ng prefix.
The ng-init directive initialize AngularJS application variables, such as:
<div ng-app=”” ng-init=”firstName=’John'”>
<p>The name is <span ng-bind=”firstName”></span></p>
</div>
In this example the value in the span of the paragraph which is named ‘firstName’
is initialized in the first line by ng-init=”firstName=’John'”.
When the page is loaded ‘John’ will be displayed in the paragraph.
For more information visit our website: www.keytorc.com