0

I've seen https://stackoverflow.com/a/36639596/6656422 this works for buttons but not ngAfterViewInit.

In this plunker https://plnkr.co/edit/p4jsdPR9varhV9ihUhO5?p=preview fileInputElement.click(); opens the browser file prompt when called from the button click but not from ngAfterViewInit even though fileInputElement is defined.

Edit: I'v tried NgZone.run() and setTimeout(), without luck.

4
  • Can you elaborate on the down vote? Commented Sep 8, 2017 at 22:50
  • I recommend you to check docs, in good projects you can manipulate the functionality programmatically. Commented Sep 8, 2017 at 23:08
  • I am familiar with the angular documentation, but it sounds like you know something I don't. Can you point me in the right direction? Commented Sep 8, 2017 at 23:16
  • Don't you use a third party library? It seemed to me that you do. If it's native angular, sorry, i have no idea how to help you =( Commented Sep 8, 2017 at 23:28

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.