AngularJS:API
| ylbtech-AngularJS:API |
| 1.返回顶部 |
AngularJS API
API 意为 Application Programming Interface(应用程序编程接口)。
AngularJS 全局 API
AngularJS 全局 API 用于执行常见任务的 JavaScript 函数集合,如:
- 比较对象
- 迭代对象
- 转换对象
全局 API 函数使用 angular 对象进行访问。
以下列出了一些通用的 API 函数:
| API | 描述 |
|---|---|
| angular.lowercase() | 转换字符串为小写 |
| angular.uppercase() | 转换字符串为大写 |
| angular.isString() | 判断给定的对象是否为字符串,如果是返回 true。 |
| angular.isNumber() | 判断给定的对象是否为数字,如果是返回 true。 |
angular.lowercase()
实例
<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);
});
</script>
angular.uppercase()
实例
<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.uppercase($scope.x1);
});
</script>
angular.isString()
实例
<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.isString($scope.x1);
});
</script>
angular.isNumber()
实例
<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.isNumber($scope.x1);
});
</script>
| 2.返回顶部 |
| 3.返回顶部 |
| 4.返回顶部 |
| 5.返回顶部 |
| 6.返回顶部 |
![]() |
作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |
AngularJS:API的更多相关文章
- AngularJS快速入门指南15:API
thead>tr>th, table.reference>tbody>tr>th, table.reference>tfoot>tr>th, table ...
- angular 中怎么获取路径上的参数 参考:https://docs.angularjs.org/api/ng/service/$location
参考: https://docs.angularjs.org/api/ng/service/$location
- AngularJs + Web API 页面开发(一)
AngularJS这个JS框架是个神马东东我也不太清楚,我也是初学者~~ AngularJS适用于single page App,单页面程序都是局部刷新的,这一点和Ajax有第一的区别,因为使用Aja ...
- AngularJS:Http
ylbtech-AngularJS:Http 1.返回顶部 1. AngularJS XMLHttpRequest $http 是 AngularJS 中的一个核心服务,用于读取远程服务器的数据. 使 ...
- AngularJS:参考手册
ylbtech-AngularJS:参考手册 1.返回顶部 1. AngularJS 参考手册 AngularJS 指令 本教程用到的 AngularJS 指令 : 指令 描述 ng-app 定义应用 ...
- [译] 企业级 OpenStack 的六大需求(第 1 部分):API 高可用、管理和安全
全文包括三部分: 第一部分:API 高可用和管理以及安全模型 第二部分:开放架构和混合云兼容 第三部分:弹性架构和全球交付 引言 OpenStack 是构造企业级私有云的非常理想的基础.它立志成为新一 ...
- AngularJS:何时应该使用Directive、Controller、Service?【新手必看】
(这篇文章你们一定要看,尤其初学的人,好吗亲?) 大漠穷秋 译 AngularJS是一款非常强大的前端MVC框架.同时,它也引入了相当多的概念,这些概念我们可能不是太熟悉.(译者注:老外真谦虚,我大天 ...
- 一场完美的“秒杀”:API加速的业务逻辑
清晨,我被一个客户电话惊醒,客户异常焦急,寻问CDN能不能帮助他们解决“秒杀”的问题,他们昨天刚刚进行了“整点秒杀活动”,结果并发量过大,导致服务宕机,用户投诉. 为了理清思路,我问了对方三个问题: ...
- spring cloud+dotnet core搭建微服务架构:Api网关(三)
前言 国庆假期,一直没有时间更新. 根据群里面的同学的提问,强烈推荐大家先熟悉下spring cloud.文章下面有纯洁大神的spring cloud系列. 上一章最后说了,因为服务是不对外暴露的,所 ...
随机推荐
- Efficient Vector Representation for Documents through Corruption-by Minmin Chen阅读
关键词: 词向量.文档向量.文档表示 地址:https://openreview.net/forum?id=B1Igu2ogg¬eId=B1Igu2ogg 首先,论文解决的是Word2V ...
- java.net.UnknownHostException异常处理
1.问题描述 最近迁移环境,在Linux系统下部署Java产品的应用,后台报出如下异常,系统报找不到名为“xxx-houtai1”的主机: 1 java.net.UnknownHostExceptio ...
- Linux嵌入式 -- 内核 - 内核定时器
1. 度量时间差 时钟中断由系统的定时硬件以周期性的时间间隔产生,这个间隔(即频率)由内核根据HZ来确定,HZ是一个与体系结构无关的常数,可配置(50-1200),在X86平台,默认值为1000(每 ...
- UOJ66 新年的巧克力棒
本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000 作者博客:http://www.cnblogs.com/ljh2000-jump/ ...
- list添加map问题
结论: list添加添加的是map的地址 List<Map<String, Object>> list = new ArrayList<>(); Map<St ...
- js组合模式
组合模式(Composite),将对象组合成树形结构以表示‘部分-整体’的层次结构.组合模式使得用户对单个对象和组合对象的使用具有一致性. 透明方式,也就是说在Commponent中声明所有用来管理子 ...
- VS2010 + QT 5 +open inventor 环境配置
本科毕业设计做的是 随钻测量的井眼轨迹和测井曲线的三维显示 要求的环境是 QT + Open Inventor 在寒假开学前,打算将环境配置好,开学后再正式编码实现,可是....环境也 ...
- 吐槽XE3中的BUG:无法调试32位的应用程序
我想用的功能在XE5中有BUG, 无奈转移到XE3中测试,发现了XE3还有另外一个问题:无法DEBUG 32位的应用程序,这算什么事啊?有人说把项目属性中的link with dynamic RTL去 ...
- cassandra cqlsh 和 python客户端
Keyspaces A cluster is a container for keyspaces. A keyspace is the outermost container for data in ...
- oracle Data blocks,Extents,Segments
转载 先看Data blocks(也叫逻辑块,oracle块,页)吧,oracle存储数据都是在这些数据块中,一个数据块是磁盘上数据库物理空间一系列物理字节的组成. 比Data blocks更高 ...
