Date Filter short

Description

The following code shows how to format a date value with Date Filter short format.

Example


<!doctype html>
<html ng-app="myApp">
<head>
  <title>Built In Filters</title>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.js"></script>
</head><!--   w  w w.j  a va  2s  . c  o m-->
<body>

  <div ng-controller="myController">
    <div>{{ today | date:'short' }}</div>

  </div>
  <script>
    angular.module('myApp', [])
    .controller('myController', function($scope, $filter) {
      $scope.today = new Date();
    })
  </script>

</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Example »




Controller
Directives
Expression
Filter
Form
Inject
Scope
Server
Style
Template
Utilities