zoukankan      html  css  js  c++  java
  • AngularJS API

    AngularJS提供了如下的一下常用函数

    API名称 描述
    anguler.lowercase() 转换为小写字母
    anguler.uppercase() 转换为大写字母
    angular,.isString() 是否为字符串
    isNumber 是否为数字

    完整的一个例子:

    <div ng-app="demo" ng-controller="mycontroller">

    <input type="text" ng-model="inutStr"></input>

    <p>input string is {{inpuStr}}</p>

    <p>to lowercase is:{{lowercaseStr}}</p>

    <p>to uppercase is:{{uppercaseStr}}</p>

    <p ng-switch="isStr">is String:

    <label  ng-switch-when="true">yes</label>

    <label  ng-switch-when="false">No</label>

    </p>

    <p ng-switch="isNum">is Number:

    <label  ng-switch-when="true">yes</label>

    <label  ng-switch-when="false">No</label>

    </p>

    </div>

    <script>

    var app=angular.module("demo",[]);

    app.controller("mycontroller",function($scope){

      $scope.lowercaseStr=angular.lowercase($scope.inputStr);

      $scope.uppercaseStr=angular.uppercase($scope.inputstr);

      $scope.isStr=angular.isString($scope.input);

      //$scope.isNum=angualr.isnum($scope.input);

    });

    </script>

  • 相关阅读:
    TPLINK TLWR710N设置详解
    hehe.....
    AS3写FTP登录过程
    QQ
    网页设计标准尺寸:
    女孩,你愿意做他的第几个女朋友
    監聽一個變量的值變化
    dispatchEvent
    10
    C#常用代码
  • 原文地址:https://www.cnblogs.com/VARForrest/p/7805580.html
Copyright © 2011-2022 走看看