Angular directive to show an auto-updating timeago text to your timestamped HTML elements (using Livestamp.js and Moment.js)
Copyright (C) 2016, Mikhael GERBET frollon.noir@gmail.com.
Get both livestamp.js, moment.js and angular-livestamp
via Bower: by running $ bower install angular-livestamp
from your console
Include both livestamp.js, moment.js and angular-livestamp.js in your application.
<script src="bower_components/moment/min/moment.min.js"></script>
<script src="bower_components/livestampjs/livestamp.min.js"></script>
<script src="bower_components/angular-spinner/angular-spinner.js"></script>
Add the module angularLivestamp
as a dependency to your app module:
var myapp = angular.module('myapp', ['angularLivestamp']);
You can now start using the mg-livestamp directive to display an auto-updating timeago text. For example :
<span mg-livestamp="2016-06-09 22:21:00"></span>
See online example on Jsfiddle.
Released under the terms of MIT License.
- Fork repo.
npm install
bower install
- Make your changes, add your tests.
grunt test
grunt build
once all tests are passing. Commit, push, PR.