1.AngularJS全局API用于执行常见任务的Javascript函数集合:

**比较对象

**迭代对象

**转换对象

2.全局API函数使用angularJS对象进行访问:以下是通用API函数:

**angular.lowercase():转换字符串为小写

**angular.uppercase():转换字符串为大写

**angular.isString():判断给定的对象是否为字符串,如果是返回true

**angular.isNumber():判断给定的对象是否为数字,如果是返回true;

3.实例:

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";

  $scopex2=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>

AngularJS学习之全局API(应用程序编程接口)的更多相关文章

  1. Flask 教程 第二十三章:应用程序编程接口(API)

    本文翻译自The Flask Mega-Tutorial Part XXIII: Application Programming Interfaces (APIs) 我为此应用程序构建的所有功能都只适 ...

  2. API(Application Programming Interface,应用程序编程接口)

    API(Application Programming Interface,应用程序编程接口)是一些预先定义的函数,目的是提供应用程序与开发人员基于某软件或硬件得以访问一组例程的能力,而又无需访问源码 ...

  3. FTK应用程序编程接口(API)手册-1【转】

    转自:http://blog.csdn.net/absurd/article/details/6702047 框架函数 框架函数支撑FTK的主体,它负责初始化应用程序,启动主循环和退出主循环.它对任何 ...

  4. JavaWeb学习之JDBC API中常用的接口和类

    JDBC API中包含四个常用的接口和一个类分别是: 1.Connection接口 2.Statement接口 3.PreparedStatement接口 4.ResultSet接口 5.Driver ...

  5. 安卓操作系统版本(Version)与应用程序编程接口等级(Application Programming Interface Level)对照表

    Android是一种基于Linux的自由及开放源代码的操作系统,主要使用于移动设备,如智能手机和平板电脑. 使用Android API,可以在Java环境开发App,编译.打包后可在Android系统 ...

  6. AngularJS学习笔记5

    11.AngularJS  HTML DOM ng-disabled 指令直接绑定应用程序数据到 HTML 的 disabled 属性. <button ng-disabled="my ...

  7. OCCI编程接口介绍

    OCCI简介 Oracle® C++ Call Interface (OCCI) 是一套应用程序编程接口,它允许C++程序与一个或者多个Oracle数据库进行交互.OCCI给予你强大的数据库操作能力, ...

  8. Vue3全局APi解析-源码学习

    本文章共5314字,预计阅读时间5-15分钟. 前言 不知不觉Vue-next的版本已经来到了3.1.2,最近对照着源码学习Vue3的全局Api,边学习边整理了下来,希望可以和大家一起进步. 我们以官 ...

  9. AngularJS的核心对象angular上的方法全面解析(AngularJS全局API)

    总结一下AngularJS的核心对象angular上的方法,也帮助自己学习一下平时工作中没怎么用到的方法,看能不能提高开发效率.我当前使用的Angularjs版本是1.5.5也是目前最新的稳定版本,不 ...

随机推荐

  1. IOS - 消息推送原理和实现

    一.消息推送原理: 在实现消息推送之前先提及几个于推送相关概念,如下图1-1: 1.Provider:就是为指定IOS设备应用程序提供Push的服务器,(如果IOS设备的应用程序是客户端的话,那么Pr ...

  2. [Android Pro] Service (startservice , bindservice , unbindservice, stopService)

    1: startService -------stopService (this will call onDestroy) 2: bindService -------unbindService    ...

  3. 数独挑战(codevs 2924)

    2924 数独挑战  时间限制: 1 s  空间限制: 1000 KB  题目等级 : 钻石 Diamond 题解  查看运行结果     题目描述 Description “芬兰数学家因卡拉,花费3 ...

  4. python如何一行输入多个值

    python2的raw_input以及python3的input获取的是整行的字符串.读进来后,字符串有着著名的split可以根据分隔符拆解成子串组成的list. 对于list内的对象,需要的采取转换 ...

  5. hdu1141(二进制数位,二分,打表)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1141 题意:××公司是制造computer的,1960年它造的computer是4bit的,之后每10 ...

  6. hdu 1005

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1005 思路:找规律题 #include<stdio.h> main() { ]; int ...

  7. 苹果官方制作MAC OS的启动U盘的步骤

    工具/原料 一个8G或者更大容量的U盘 MAC OS系统镜像DMG文件 方法/步骤 1.打开应用程序 - 使用工具里的磁盘工具,将U盘格式化为MAC OS扩展日志式,名称输入Mavericks,并创建 ...

  8. Powershell实例小结(服务管理)

    有关服务管理的具体实例脚本如下: #$lists="1.1.1.1","2.2.2.2" #远程ip列表 foreach ($list in $lists){ ...

  9. ROW_NUMBER()函数的使用

    SQL Server数据库ROW_NUMBER()函数的使用是本文我们要介绍的内容,接下来我们就通过几个实例来一一介绍ROW_NUMBER()函数的使用. 实例如下: .使用row_number()函 ...

  10. Linux USB Project

    转自:http://www.linux-usb.org/ Welcome to the home of the Linux USB Project This web site was created ...