<!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script> <body> <div ng-app="" ng-init="person={firstName:'Working',lastName:'Code'}"> <p>The name is {{ person.lastName }}</p> </div> </body> </html>
Output:
The name is Working
AngularJS objects with Example
Working Code Asked question September 21, 2023