My Ember app has renders a list of items using a component for each item, as many do. In the component, I can open a modal with a report. I’d like to be able to add a print button to that modal, which prints only the content in the modal. It looks like something like the ‘printjs’ package would work for this. However, I’m having difficulty figuring out how to access the element in my component action.
I’m using the Ember-Bootstrap plugin, with the modal being in a BsModal component.
I’ve experimented with using the click() handler in the component; I could make that work but it feels very ugly. I could make it less ugly by making the modal portion its own component, I suppose.
I’d really like to just be able to pass the button element itself, or some relevant DOM element, to the “print” action on the component. Am I missing something or is using a DOM event handler like click the only way to do this?