angular.equals
home
Run
screen_rotation
fullscreen
cloud_download
navigate_before
<!DOCTYPE html> <html lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> <script> var myApp = angular.module("myApp", []); myApp.controller("myController", function($scope) { $scope.result = ""; $scope.user1 = ""; $scope.user2 = ""; $scope.compareObjs = function() { $scope.result = angular.equals($scope.user1, $scope.user2); }; }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <b>User 1</b><br> Name <input type="" ng-model="user1.name"><br> Phone <input type="" ng-model="user1.phone"><br> <b>User 1</b><br> Name <input type="" ng-model="user2.name"><br> Phone <input type="" ng-model="user3.phone"><br> <button ng-click ="compareObjs()">Compare Values</button> <br> Result = {{result}} </div> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> <script> var myApp = angular.module("myApp", []); myApp.controller("myController", function($scope) { $scope.result = ""; $scope.user1 = ""; $scope.user2 = ""; $scope.compareObjs = function() { $scope.result = angular.equals($scope.user1, $scope.user2); }; }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <b>User 1</b><br> Name <input type="" ng-model="user1.name"><br> Phone <input type="" ng-model="user1.phone"><br> <b>User 1</b><br> Name <input type="" ng-model="user2.name"><br> Phone <input type="" ng-model="user3.phone"><br> <button ng-click ="compareObjs()">Compare Values</button> <br> Result = {{result}} </div> </div> </body> </html>
Copyrights@tutorialsplane.com