Skip to content

Angular directive to show an auto-updating timeago text to your timestamped HTML elements (using Livestamp.js and Moment.js)

Notifications You must be signed in to change notification settings

MikhaelGerbet/angular-livestamp

Repository files navigation

angular-livestamp

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.

Coverage Status Build Status Bower version Dependency Status devDependency Status

Usage

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>

Example

See online example on Jsfiddle.

License

Released under the terms of MIT License.

Contributing

  1. Fork repo.
  2. npm install
  3. bower install
  4. Make your changes, add your tests.
  5. grunt test
  6. grunt build once all tests are passing. Commit, push, PR.

About

Angular directive to show an auto-updating timeago text to your timestamped HTML elements (using Livestamp.js and Moment.js)

Resources

Stars

Watchers

Forks

Packages

No packages published