加载中...

其它


8.3. 其它

时间戳格式化 date

  1. <div ng-controller="TestCtrl">
  2. {{ a | date: 'yyyy-MM-dd HH:mm:ss' }}
  3. </div>
  4. <script type="text/javascript">
  5. var TestCtrl = function($scope){
  6. $scope.a = ((new Date().valueOf()));
  7. }
  8. angular.bootstrap(document.documentElement);
  9. </script>

列表截取 limitTo ,支持正负数:

  1. {{ [1,2,3,4,5] | limitTo: 2 }}
  2. {{ [1,2,3,4,5] | limitTo: -3 }}

大小写 lowercaseuppercase

  1. {{ 'abc' | uppercase }}
  2. {{ 'Abc' | lowercase }}

还没有评论.