Bài 24 Angularjs Global API phần 1
Lượt xem: 2145
Xem demo
Làm thế nào để sử dụng Angularjs Global API
Trong bài này cung cấp các mẫu để giúp bạn biết làm thế nào để sử dụng sau API chung: angular.isString (), angular.isNumber (), angular.lowercase () và angular.uppercase ().
1. Sử dụng angular.isString() như thế nào
Chúng ta cùng xem ví dụ sau:
<html>
<head>
<title> CAngular.isString()</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<script>
var app = angular.module('MyForm', []);
app.controller('myCtrl', function($scope) {
$scope.a = "AngularJS";
$scope.b = angular.isString($scope.a);
});
</script>
</head>
<body ng-app="MyForm">
<div ng-controller="myCtrl">
<p>{{ a }} </p>
<p>{{ b }} </p>
</div>
</body>
</html>
Xem demo
Có thể bạn quan tâm
-
Sử dụng biểu tượng @ trong php là gì? -
Bài 18: Làm thế nào để sử dụng ng-pattern trong Angularjs -
[Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))