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

  • Owner: oojr/inspiration
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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

Main metrics

Overview
Name With Owneroojr/inspiration
Primary LanguageCSS
Program languageCSS (Language Count: 2)
Platform
License:
所有者活动
Created At2014-02-10 20:33:36
Pushed At2014-02-10 23:45:16
Last Commit At2014-02-10 18:44:54
Release Count0
用户参与
Stargazers Count17
Watchers Count0
Fork Count0
Commits Count3
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count0
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private