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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?