0.1.0 • Published 8 years ago

ember-imgur v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

Ember-imgur Build Status

This Ember Service allows you to upload and get images from imgur.

Installation

ember install ember-imgur

How to use it

Setup your Client-ID in the config/environment.js file of your project.

var ENV = {
    imgur: {
      clientId: 'YOUR_ID'
    }
};

Then, simply inject the service in your controller or anything else.

export default Ember.Controller.extend({
	imgur: Ember.inject.service()
});

Post an image

imageData is the base64 representation of the image. It shouldn't include the data:image/png;base64, prefix. You can also pass an URL.

this.get('imgur').imagePost(imageData).then((result) => {
	//Result from imgur
}).catch((result) => {
	//Error
});

Get an image

this.get('imgur').imageGet(imageId).then((result) => {
	//Result from imgur
}).catch((result) => {
	//Error
});

Feel free to implement additional features to this addon.