oojr / inspiration

the angular-kudos directive is a svbtle-style kudos implementation with AngularJS, this repo is an example of how it could be used with Firebase

Home Page:http://olaji.de/inspiration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

angular-kudos directive

Demo Page

A svbtle-style kudos implementation with AngularJS and Firebase

Getting Started

  1. include angular.js ,ngStorage.js , angular-kudos.js and kudos.css into your HTML
  2. include angular-kudos in your application's module dependencies.
  3. Use the og-kudos directive.

Example

<div og-kudos>
</div>

This alone would work but it needs a little extra configuration (see attributes) for persistence.

Attributes

og-kudos-id

You can give a kudo a unique id to track if a user already voted on a kudo with the particular id, it could take a string or an {{}} expression

Example:

<div ng-repeat="quote in quotes">
  <div og-kudos
       og-kudos-id="{{quote.id}}">
 </div>
</div>

og-kudos-count

You could return a number of how many kudos were filled in with this attribute, it could take a string or an {{}} expression

Example:

<div ng-repeat="quote in quotes">
  <div og-kudos
       og-kudos-id="{{quote.id}}"
       og-kudos-count="{{quotes.kudos}}">
 </div>
</div>

og-kudos-done

You can pass in a function for when a kudos action is complete with this attribute

Example:

<div ng-repeat="quote in quotes">
  <div og-kudos
       og-kudos-id="{{quote.id}}"
       og-kudos-count="{{quotes.kudos}}"
       og-kudos-done="addCount(quote.id)">
 </div>
</div>

Controller

an example controller that has angular-kudos and firebase as a dependency can be found here

Credits

License

MIT

About

the angular-kudos directive is a svbtle-style kudos implementation with AngularJS, this repo is an example of how it could be used with Firebase

http://olaji.de/inspiration


Languages

Language:CSS 99.5%Language:JavaScript 0.5%