<!DOCTYPE html>
<html lang="en" ng-app="compare">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="js/angular.min.js"></script>
</head>
<body ng-controller="con1">
<h2>User 1</h2>
Name: <input type="text" ng-model="User1.name">
Age : <input type="text" ng-model="User1.age">
<h2>User 2</h2>
Name: <input type="text" ng-model="User2.name">
Age : <input type="text" ng-model="User2.age"><br />
<div>{{User1}}</div>
<div>{{User2}}</div>
<input type="button" value="contrast" ng-click="com()">
<div>{{result}}</div>
<script>
angular.module('compare',[]).
controller('con1',function ($scope) {
$scope.User1 = {};
$scope.User2 = {};
$scope.result;
$scope.com = function () {
$scope.result = angular.equals($scope.User1,$scope.User2);
}
})
</script>
</body>
</html>