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?

tony19
  • 125,647
  • 18
  • 229
  • 307

1 Answers1

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.

Community
  • 1
  • 1
Tonio
  • 4,082
  • 4
  • 35
  • 60