Ember component wrapper for the great printThis jQuery plugin.
Install ember-print-this
into your ember-cli project via:
ember install ember-print-this
By default, anything placed into the block will get printed. To print as soon as the content is rendered, you must specify the autoPrint property as true in the component.
All options supported by printThis can be passed in through an options param to the component.
printThisOptions: {
printDelay: 500
}
A custom selector can be provided so only part of the block is printed.
Printing can be executed via a yielded action to the block.
Printing can be done via a service.
export default Ember.Component.extend({
printThis: Ember.inject.service(),
actions: {
doPrint() {
const selector = '.myClass';
const options = {
printDelay: 500
}
this.get('printThis').print(selector, options);
}
},
});
git clone [email protected]:LucasHill/ember-print-this.git
this repositorycd ember-print-this
npm install
bower install
ember serve
- Visit your app at http://localhost:4200.
npm test
(Runsember try:each
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit https://ember-cli.com/.