angular.lowercase();将字符串转为小写
angular.uppercase();将字符串转为大写
angular.isString();判定对象是字符串返回true
angular.isNumber();判定对象是数字返回true
<div ng-app="myApp" ng-controller="myCtrl"> {{X1}} {{X2}} </div> <script> var app=angular.module("myApp",[]); app.controller("myCtrl",function($scope) { $scope.X1="TOM"; $.scope.X2=angular.lowercase($scope.X1); //输出tom $scope.X1="tom" $scope.X2=angular.uppercse($scope.X1); //输出TOM $scope.X1="tom"; $scope.X2=angular.isString($scope.X1);//输出true $scope.X1="tom"; $scope.X2=angular.isNumber($scope.X1);//输出false }); </script>
时间: 2024-11-05 11:50:19