yiom / ember-cli-sketchpad

A ember-cli wrapper for Sketchpad (http://yiom.github.io/sketchpad/)
MIT License
3 stars 0 forks source link

ember-cli-sketchpad

An Ember.js addon to include a simple sketchpad based on sketchpad library.

NPM

Instalation

To install Sketchpad via NPM:

$ npm install ember-cli-sketchpad --save-dev

Usage

Just add the following component to your application:

{{input-sketchpad width=400 height=400 value=sketchpad class="sketchpad"}}

After that, you should be able to access your sketchpad with the variable you used on the 'value' field

export default Ember.Controller.extend({
  actions: {
    undo: function(sketchpad) {
      this.get('sketchpad').undo();
    },
    redo: function(sketchpad) {
      this.get('sketchpad').redo();
    },
  },
});

The Sketchpad Object API follows the same as the sketchpad library.