Skip to content

Instantly share code, notes, and snippets.

View abourget's full-sized avatar

Alexandre Bourget abourget

View GitHub Profile
@abourget
abourget / directives.js
Created August 8, 2012 20:24
Hammer.js integration with AngularJS
/**
* Inspired by AngularJS' implementation of "click dblclick mousedown..."
*
* This ties in the Hammer events to attributes like:
*
* hm-tap="add_something()"
* hm-swipe="remove_something()"
*
* and also has support for Hammer options with:
*

Problem:

  • We want to keep the experiments for payments/billing/usage report/authentication coherent and unified
  • We also want to have multiple distributed gateways of the network.
  • These are the tensions between a centralizing vs decentralizing different components.

Solution:

  • Provide an API that allows someone to emerge as a great UI for payments/billing/usage report/authentication, yet distributes the provisioning of the service to various gateways operated by multiple organisations.
  • By defining a protocol, there also exists competition at that UI level, but gateway operators/providers of service would have an established way of communicating with that UI, in a standardized way, and move to use the best front-end (or use multiple).
  • May the best win!