Ember-cli-filepicker
Installation
ember install:addon ember-cli-filepicker
Usage
- Create your filepicker.io key using the following URL: https://www.filepicker.io/.
- Add your filepicker.io key in your config/environment.js
//config/environment.jsmodule { var ENV = //... filepickerKey: '<your-filepicker-key>' ; //...}
- Use the filepicker.io documentation for options like extensions and services.
- In your template:
{{ember-filepicker pickerOptions=pickerOptions onSelection='fileSelected' onClose='onClose' onError='onError'}}
-
The above will use the pick method.
-
You should pass pickerOptions with the pick options (mimetype, services, etc).
-
If you want to use pickAndStore, also pass storeOptions (location, etc):
{{ember-filepicker pickerOptions=pickerOptions storeOptions=storeOptions onSelection='fileSelected' onClose='onClose' onError='onError'}}
- If you want to use pickMultiple files (without storing them), pass multiple=true :
{{ember-filepicker pickerOptions=pickerOptions multiple=true onSelection='fileSelected' onClose='onClose' onError='onError'}}
Notes
In order to have access to the filepicker
instance you can:
- If
Ember.inject.service
is supported then in your object you can use:
Component;
- Otherwise, you can use the lookup method:
Component;
Running
ember server
- Visit your app at http://localhost:4200.
Running Tests
npm test
(Runsember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit http://ember-cli.com/.