What is AngularJS ?
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 can be added to an HTML page with a <script> tag, such as:
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>
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