angular.equals
home
Run
screen_rotation
fullscreen
cloud_download
navigate_next
<!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.value1 = ""; $scope.value2 = ""; $scope.compareValues = function() { $scope.result = angular.equals($scope.value1, $scope.value2); }; }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> Value 1 <input type="" ng-model="value1"><br> Value 2 <input type="" ng-model="value2"><br> <button ng-click ="compareValues()">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.value1 = ""; $scope.value2 = ""; $scope.compareValues = function() { $scope.result = angular.equals($scope.value1, $scope.value2); }; }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> Value 1 <input type="" ng-model="value1"><br> Value 2 <input type="" ng-model="value2"><br> <button ng-click ="compareValues()">Compare Values</button> <br> Result = {{result}} </div> </div> </body> </html>
Copyrights@tutorialsplane.com