0

I have an HTML page that has an option for drag-n-drop and a "Preview" button. I want to call a function on the click event of that button, which will fetch all the files that are dragged onto the page. When I press this button, it opens a <px-modal> (a popup which displays some data), and it has a dropdown (<paper-dropdown> and <paper-item>), which should display the filename fetched earlier.

So I have the data, but I don't know how to store it or display it as dropdown content.

I have tried the <template> tag, but it fires on page-load when I need it to fire after the files are dropped onto the page. Otherwise, the data is null.

How do I solve this?

1 Answer 1

0

Without some code to look at, it's hard to help you but in general, my advice will be to use a service to store your data and all your directive/controller that needs to have access to the data should havce a dependency on this service.

Have a look at option 1 on this answer

If that's not what you're looking for, post more details, create a jsFiddle to show us where you are so we can help you better.

Sign up to request clarification or add additional context in comments.

1 Comment

The linked answer is an Angular-specific solution, but the OP is using only Polymer.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.