python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
data-ng-init angular

data-ng-init angular

The "data-ng-init" are used to initialize the application data and it's also called to ng-init and does not create a new scope and it's used to evaluate an expressions in the current scope.

The example angular array code as given below.

[{name:'Anil Singh',city:'Noida, India'},
{name:'Sunil ',city:'UP India'},
{name:'code-sample.com',city:'www'}]

The example HTML code as given below.

<div data-ng-init="details=[{name:'Anil Singh',city:'Noida, India'},{name:'Sunil ',city:'UP'},{name:'code-sample.com',city:'www'}]">
        <ul>
            <li data-ng-repeat="detail in details">
               {{detail.name}} : {{detail.city}}
            </li>
        </ul>
    </div>

The full live code as given below.

<!DOCTYPE html>
<html>
<head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
</head>
<body ng-app>
    <div data-ng-init="details=[{name:'Anil Singh',city:'Noida, India'},{name:'Sunil ',city:'UP'},{name:'code-sample.com',city:'www'}]">
        <ul>
            <li data-ng-repeat="detail in details">
               {{detail.name}} : {{detail.city}}
            </li>
        </ul>
    </div>
</body>
</html>

The live output demo : go to below link
ANIL SINGH

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions