Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including angular-momentjs with all npm packages installed. Try it out:

angular-momentjs lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("angular-momentjs/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

angular-momentjs v0.2.2

Moment.js for Angular.js

angular-momentjs Build Status

Moment.js with Angular.js

#How do I add this to my project?

You can download angular-momentjs by:

#Example usage

<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();

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free