Moment.js for Angular.js

npm install angular-momentjs
1 downloads in the last day
8 downloads in the last week
51 downloads in the last month

angular-momentjs Build Status

Moment.js with Angular.js

How do I add this to my project?

You can download angular-momentjs by:

<body ng-app="YOUR_APP" ng-controller="MainCtrl">
 {{ time }}
 {{ anotherTime }}
<script src=""></script>
<script src=""></script>
<script src="app/bower_components/angular-momentjs/angular-momentjs.js"></script>
  angular.module('YOUR_APP', [
  ]) // you're able to set Default settings

  angular.module('controllers', [])
    .controller('MainCtrl', function($scope, $moment) {
      // If didn't set asyncLoading angular-momentjs
      // will assume you provided moment.js
      $scope.time = $moment("20111031", "YYYYMMDD").fromNow();

      // If you set asyncLoading to true then angular-momentjs
      // will inject the script and return a promise
      $moment.then(function(moment) {
        $scope.anotherTime = moment("20111031", "YYYYMMDD").fromNow();
npm loves you