手册
目录
AngularJS 全局 API 是一套全局 JavaScript 函数,用于执行一些常见的任务,例如:
全局 API 函数通过使用 angular 对象进行访问。
下面是一些常用 API 函数的列表:
| API | 描述 |
|---|---|
| angular.lowercase() | 将字符串转换为小写。 |
| angular.uppercase() | 将字符串转换为大写。 |
| angular.isString() | 如果引用是字符串,则返回 true。 |
| angular.isNumber() | 如果引用是数字,则返回 true。 |
<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 = "BILL";
$scope.x2 = angular.lowercase($scope.x1);
});
</script>
运行实例 »点击 "运行实例" 按钮查看在线实例
<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 = "Bill";
$scope.x2 = angular.uppercase($scope.x1);
});
</script>
运行实例 »点击 "运行实例" 按钮查看在线实例
<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 = "BILL";
$scope.x2 = angular.isString($scope.x1);
});
</script>
运行实例 »点击 "运行实例" 按钮查看在线实例
<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 = "BILL";
$scope.x2 = angular.isNumber($scope.x1);
});
</script>
运行实例 »点击 "运行实例" 按钮查看在线实例
相关
视频
RELATED VIDEOS
科技资讯
1
2
3
4
5
6
7
8
9
精选课程
共5课时
17.3万人学习
共49课时
77.4万人学习
共29课时
62万人学习
共25课时
39.5万人学习
共43课时
71.3万人学习
共25课时
61.9万人学习
共22课时
23.1万人学习
共28课时
34.1万人学习
共89课时
125.8万人学习