Angular ng init directive Example
Today, We want to share with you Angular ng init directive Example.
In this post we will show you Angular ng init directive Example, hear for Angular ng init directive Example we will give you demo and example for implement.
In this post, we will learn about Angular ng init directive Example with an example.
AngularJS: scope of ng-init directive
The ng-init directive attribute allows you to all evaluate scope to an expression in the simple current scope in angular.
The ng-init directive Simple initializes app’s data.
The ng-init directive Basic defines load to initial values for an AngularJS App’s.
Syntax of the ng-init directive
[html]
….something code
[/html]
Usage of ng-init directive
[php]
{{myText}}
The ng-init Simple directive has created an AngularJS variable to used App’s, which can be used in the Singal page application.
[/php]
index.html
[php]
http://infinityknow.com/libs/angular.min.js
http://app.js
[/php]
app.js
[php]
var myapp = angular.module(‘infinityknowApp’, []);
myapp.controller(‘myController’, function($scope) {
});
[/php]
Example : 2 Basic Expression of the ng-init demo
index.html
[php]
http://infinityknow.com/libs/angular.min.js
[/php]