Angularjs 过滤器
1. uppercase
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<!
DOCTYPE
html>
<
html
>
<
head
>
<
meta
charset="utf-8">
<
script
src="http://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></
script
>
</
head
>
<
body
>
<
div
ng-app="myApp" ng-controller="personCtrl">
<
p
>姓名为 {{ lastName | uppercase }}</
p
>
</
div
>
<
script
src="personControlle.js"></
script
>
</
body
>
</
html
>
|
控制器
1
2
3
4
5
6
7
|
angular.module('myApp', []).controller('personCtrl', function($scope) {
$scope.firstName = "John",
$scope.lastName = "Doe",
$scope.fullName = function() {
return $scope.firstName + " " + $scope.lastName;
}
});
|
效果图
本文转自Work Hard Work Smart博客园博客,原文链接:http://www.cnblogs.com/linlf03/p/7137952.html,如需转载请自行联系原作者