大写过滤器在AngularJS中用来将字符串更改为大写字符串或字母.
语法如下:
{{ string | uppercase}}
例子:
<!DOCTYPE html>
< html >
< head >
< title >
uppercase Filter
</ title >
< script src =
"https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js" >
</ script >
</ head >
< body ng-app = "app"
style = "text-align:Center" >
< h1 style = "color:green" >
lsbin
</ h1 >
< h2 >
uppercase Filter
</ h2 >
< div ng-controller = "geek" >
< p >
< span style = "color:green" >
{{msg | uppercase}}
</ span > is the computer
science portal for geeks.
< p >
</ div >
< script >
angular.module('app', [])
.controller('geek', ['$scope', function($scope) {
$scope.msg = 'lsbin';
}]);
</ script >
</ body >
</ html >
输出如下: