<!doctype html> <html ng-app="ExpressionDemoApp"> <head> <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script> </head> <body> <div ng-controller="ExpressionController" ng-init="person={firstname:'Ashish' ,lastname:'Sahu'}"> Addition: {{addition}}<br> First Name : {{person.firstname}} <br> Last Name : {{person.lastname}} </div> <script> var app=angular.module("ExpressionDemoApp",[]); app.controller("ExpressionController",function($scope){ $scope.a=5; $scope.b=10; $scope.addition=$scope.$eval('a+b'); }); </script> </body> </html>
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more