Angular ng init directive Example

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.

READ :  How to Find The Total Number of Products in WP REST API v3?

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]

AngularJS infinityknow.com
http://infinityknow.com/libs/angular.min.js
http://app.js

2012 | 2013

Showing {{ model.newyear }}

2012 | 2013

Showing {{ model.newyear }}

[/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

{{ 5 + 5 }}

READ :  Angular Access-Control-Allow-Origin PHP htaccess


{{ qty * cprice }}

[/php]

Leave a Comment