import environment from '../config/environment';
import injectScript from 'ember-inject-script';
import Ember from 'ember';

var resolveFn;

export default (Ember.Service || Ember.Object).extend({
	init: function() {
		injectScript(this.get('scriptURL')).then(function() {
			filepicker.setKey(this.get('key'));
			this.set('instance', filepicker);
			resolveFn(filepicker);
		}.bind(this));
	},
	key: environment.filepickerKey || environment.APP.filepickerKey,
	scriptURL : '//api.filepicker.io/v1/filepicker.js' || environment.filepickerURL || environment.APP.filepickerURL,
	promise: new Ember.RSVP.Promise(function(resolve, reject) {
		resolveFn = resolve;
	}),
	instance: null 
});
@@ -1,26 +1,21 @@
 import 
-environment
+config
  from '.
@@ -390,27 +390,22 @@
 ,%0A%09key: 
-environment
+config
 .filepic
@@ -410,35 +410,30 @@
 ickerKey %7C%7C 
-environment
+config
 .APP.filepic
@@ -495,27 +495,22 @@
 .js' %7C%7C 
-environment
+config
 .filepic
@@ -519,27 +519,22 @@
 rURL %7C%7C 
-environment
+config
 .APP.fil

change var name