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

  • 所有者: oojr/inspiration
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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

主要指標

概覽
名稱與所有者oojr/inspiration
主編程語言CSS
編程語言CSS (語言數: 2)
平台
許可證
所有者活动
創建於2014-02-10 20:33:36
推送於2014-02-10 23:45:16
最后一次提交2014-02-10 18:44:54
發布數0
用户参与
星數17
關注者數0
派生數0
提交數3
已啟用問題?
問題數0
打開的問題數0
拉請求數0
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?