Read Catalogue
Back to top use case
- 1 First, all objects that meet the A = = = 3 will return true in Angular.equals (A, B)
- 2 The types of all objects, and the same property values, also return True
- 3 Nan and Nan also return True (in JavaScript, the return is false)
- 4 regular will also return True (in javascirpt,/abc//abc/is considered unequal)
Back to top example
<HTML><Head> <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /> <Scriptsrc= "Http://apps.bdimg.com/libs/angular.js/1.2.16/angular.min.js"></Script></Head><BodyNg-app= "MYAPP"> <DivNg-controller= "Myctrl">{{A_equals}} {{User_equals}} {{ nan_equals}} {{reg_equals} }</Div> <Scripttype= "Text/javascript">Angular.module ("myApp", []). Controller ("Myctrl",function($scope) {vara= 3; $scope. A_equals=Angular.equals (A,3);//A = = 3 varUser1= {"name":"Xing"," Age": -}; varUser2= {"name":"Xing"," Age": -}; $scope. User_equals=angular.equals (USER1,USER2); $scope. Nan_equals=angular.equals (Nan,nan);//In Javascirpt is false$scope. Reg_equals=Angular.equals (/ABC/,/ABC/);//In JavaScript is false }); </Script></Body></HTML>
Run will get four true
AngularJS API Equal Comparison object