Gratuitous AngularJS Examples

3. Filtering, showing time based on simple date binding

by Eric McCormick

HTML

<div ng-app ng-controller="myCtrl">
    <span>{{ dt | date: 'shortTime' }}</span>
    
    <script type="text/javascript">
        function myCtrl($scope) {
            $scope.dt = new Date();
        }
    </script>
</div>