Displaying data with angular js object example
<!DOCTYPE html>
<html lang="en" ng-app="myapp">
<head>
<meta charset="UTF-8">
<title>Anuglar js Controller Example</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
</head>
<body>
<div ng-controller="myController">
<h1>User Details</h1>
Full Name : {{person.name} } <br/>
Mobile No : {{person.mobile} } <br/>
Country : {{person.country} } <br/>
</div>
</body>
<script>
var app = angular.module('myapp', []);
app.controller('myController',function($scope){
var person = {
name : 'Manikanta',
mobile : '9553517603',
country : 'India'
}; //created person object
$scope.person = person;
})
</script>
</html>
<!DOCTYPE html>
<html lang="en" ng-app="myapp">
<head>
<meta charset="UTF-8">
<title>Anuglar js Controller Example</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
</head>
<body>
<div ng-controller="myController">
<h1>User Details</h1>
Full Name : {{person.name} } <br/>
Mobile No : {{person.mobile} } <br/>
Country : {{person.country} } <br/>
</div>
</body>
<script>
var app = angular.module('myapp', []);
app.controller('myController',function($scope){
var person = {
name : 'Manikanta',
mobile : '9553517603',
country : 'India'
}; //created person object
$scope.person = person;
})
</script>
</html>
Output
User Details
Full Name : {{person.name}}Mobile No : {{person.mobile}}
Country : {{person.country}}
0 comments:
Post a Comment