Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-filepicker

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-filepicker

Ember cli file picker using filepicker.io

  • 0.1.96
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-78.57%
Maintainers
2
Weekly downloads
 
Created
Source

Ember-cli-filepicker

npm version Build Status Ember Observer Score

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.js
module.exports = function(environment) {
  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:
export default Ember.Component.extend({
	//injecting the filepicker object
	filepicker: Ember.inject.service(),

	someFunction: function(){
		//Use the promise in case you are not sure that your component will be surly initialized after filepicker has been loaded
		this.get('filepicker.promise').then(function(filepicker){
			//do something with filepicker
		});

		//OR if you are sure filepicker has already been loaded use:
		this.get('filepicker.instance')
	}
});
  • Otherwise, you can use the lookup method:
export default Ember.Component.extend({
	//injecting the filepicker object
	filepicker: Ember.inject.service(),

	someFunction: function(){
		var filepicker = this.container.lookup('service:filepicker');
		//do something with the filepicker.instance or filepicker.promise
	}
});

Running

Running Tests

  • npm test (Runs ember 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/.

Keywords

FAQs

Package last updated on 26 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc