AngularJS Objects

AngularJS objects are like JavaScript objects.

Sample Code:

<!DOCTYPE html>
<html>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<body>
<div ng-app="" ng-init="person={firstName:'First',lastName:'Last'}">
<p>The lastname is {{ person.lastName }}</p>
</div>
</body>
</html>

Output:


Cheers!!!

No comments:

Post a Comment