angularjs数据类型判断及比较

<!DOCTYPE html>
<html>
    <head>
        <Meta charset="UTF-8">
        <title></title>
        <script type="text/javascript" src="js/angular.min.js" ></script>
    </head>
    <body>
        <div id="" ng-app="hd" ng-controller="ctrl">

        </div>
        <script> var m=angular.module("hd",[]); m.controller("ctrl",["$scope",function($scope){ var variable; console.log(angular.isUndefined(variable)) //true var numParam=90; console.log(angular.isNumber(numParam)); //true; var strParam="str is string"; console.log(angular.isstring(strParam));//true; var objParam={}; console.log(angular.isObject(objParam));//true; var script=document.getElementsByTagName('script').item(0); console.log(angular.isElement(script)); //true; //compare objects obj1={name:"张三"}; obj2={name:"张三"} console.log(angular.equals(obj1,obj2));//true }]); </script>
    </body>
</html>

相关文章

ANGULAR.JS:NG-SELECTANDNG-OPTIONSPS:其实看英文文档比看中...
AngularJS中使用Chart.js制折线图与饼图实例  Chart.js 是...
IE浏览器兼容性后续前言 继续尝试解决IE浏览器兼容性问题,...
Angular实现下拉菜单多选写这篇文章时,引用文章地址如下:h...
在AngularJS应用中集成科大讯飞语音输入功能前言 根据项目...
Angular数据更新不及时问题探讨前言 在修复控制角标正确变...