Showing posts with label ng-init. Show all posts
Showing posts with label ng-init. Show all posts

Wednesday, February 11, 2015

ng-init directive

The ng-init directive, is used to initialize specific variables and use them within expressions. It acts more like a Declare statement where we can specify name/value pairs of variables. Before starting with any AngularJs example make sure you download and refer to a local copy of the Angularjs library file, or refer to one of the online libraries for AngularJS.

Following is a simple example of using ng-init directive to declare a Name variable and assign a value to it.