AngularJS(11)-API

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>API</title>
    <script src="angular-1.4.1/angular.min.js"></script>
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
    <p>{{x1}}</p>
    <p>{{x2}}</p>
</div>
<script>
    var app = angular.module('myApp',[]);
    app.controller('myCtrl', function ($scope) {
        $scope.x1 = 'JOHN';
//        $scope.x2 = angular.lowercase($scope.x1); //输出john  uppercase为转大写
//        $scope.x2 = angular.isString($scope.x1);   //输出true
        $scope.x2 = angular.isNumber($scope.x1);    //输出false
    });
</script>
</body>
</html>

  

posted @ 2016-09-28 15:53  My Way!  阅读(136)  评论(0编辑  收藏  举报