filter服务
<body ng-app="app" ng-controller="xmgController">
<!--<p ng-bind="nowTime | date:'yyyy-MM-dd hh:mm:ss Z'"></p>-->
<p ng-bind="nowTime"></p>
<p ng-bind="str"></p>
</body>
<script src="js/angular.js"></script>
<script>
//1.创建模块
var app = angular.module('app', []);
//2.创建控制器
app.controller('xmgController', ['$scope', '$filter', function ($scope, $filter) {
//2.1 日期过滤
$scope.nowTime = new Date();
//指定过滤器
//日期过滤器 $filter('date'), 货币过滤器 $filter('currency')
var dateFilter = $filter('date');
//进行过滤, 指定格式
$scope.nowTime = dateFilter($scope.nowTime = new Date(), 'yyyy-MM-dd');
//2.2 大写过滤
$scope.str = "xmg";
$scope.str = $filter('uppercase')($scope.str);
}]);
//3.绑定模块 ng-app="app"
//4.绑定控制器 ng-controller="xmgController"
</script>