AngularJS Tutorial(15)from w3school
2015-08-04 09:29
579 查看
API stands for Application Programming
Interface.
Comparing objects
Iterating objects
Converting data
The Global API functions are accessed using the angular object.
Below is a list of some common API functions:
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>
Try it Yourself »
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>
Try it Yourself »
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>
Try it Yourself »
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>
Try it Yourself »
API stands for Application Programming
Interface.
AngularJS Global API
The AngularJS Global API is a set of global JavaScript functions for performing common tasks like:Comparing objects
Iterating objects
Converting data
The Global API functions are accessed using the angular object.
Below is a list of some common API functions:
API | Description |
---|---|
angular.lowercase() | Converts a string to lowercase |
angular.uppercase() | Converts a string to uppercase |
angular.isString() | Returns true if the reference is a string |
angular.isNumber() | Returns true if the reference is a number |
angular.lowercase()
Example
<divng-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>
Try it Yourself »
angular.uppercase()
Example
<divng-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>
Try it Yourself »
angular.isString()
Example
<divng-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>
Try it Yourself »
angular.isNumber()
Example
<divng-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>
Try it Yourself »
相关文章推荐
- AngularJS Tutorial(14)from w3school
- AngularJS Tutorial(13)from w3school
- AngularJS Tutorial(12)from w3school
- AngularJS Tutorial(11)from w3school
- AngularJS Tutorial(10)from w3school
- AngularJS Tutorial(9)from w3school
- AngularJS Tutorial(8)from w3school
- AngularJS Tutorial(7)from w3school
- AngularJS Tutorial(6)from w3school
- AngularJS Tutorial(5)from w3school
- AngularJS Tutorial(4)from w3school
- AngularJS Tutorial(3)from w3school
- AngularJS Tutorial(2)from w3school
- AngularJS Tutorial(1)from w3school
- angularjs入门案例 新玩具-中午吃神马
- angular之Directive - Compile vs. Link
- angularjs calling order
- AngularJs学习笔记--Creating Services
- angular之directive定义对象说明
- Angularjs中的标签模式和html5模式