Sunday, 1 September 2013

Angularjs - Fire button2's click event by clicking button1 (fake upload button)

Angularjs - Fire button2's click event by clicking button1 (fake upload
button)

To replace ugly file upload button with stylish fake upload button, I use
jquery as below.
HTML
<input type='file' name='file' class='file_upload_btn' style='display:none'>
<button class='fake_upload_btn'>Upload Files</button>
jQuery
$('.fake_upload_btn').click(function() {
$('.file_upload_btn').click();
})
Now what if I want do the same in Angularjs, without Jquery library
dependency.

No comments:

Post a Comment