angularjs数据类型判断及比较

前端之家收集整理的这篇文章主要介绍了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>
原文链接:https://www.f2er.com/angularjs/148338.html

猜你在找的Angularjs相关文章