Skip to content

Instantly share code, notes, and snippets.

@ef4
Created December 11, 2014 21:41
Show Gist options
  • Save ef4/1f14ba48a9999379b89a to your computer and use it in GitHub Desktop.
Save ef4/1f14ba48a9999379b89a to your computer and use it in GitHub Desktop.
export default Ember.Component.extend({
didInsertElement: function() {
this.canvas = new fabric.Canvas(this.get('element'));
this.drawSomeStuffUsingCanvas();
},
updateSomething: Ember.observer('someField', function(){
// Change canvas to reflect 'this.someField'
})
})
@ef4
Copy link
Author

ef4 commented Dec 11, 2014

This would go into "app/components/fabric-canvas.js".

Then you would use in a template like:

{{fabric-canvas someField=model.someField}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment