Why is this Upload File form example working in Index.html
and does not work in any component.html
file?
If i move it to any component.html clicking Add File does not even open the browse dialog.
<form id="upload" method="post" action="upload.php" enctype="multipart/form-data">
<div id="drop">
<a>Add File</a> Drag and Drop
<input type="file" name="upl" />
</div>
<ul id="uploadList"></ul>
</form>
Edit: I must mention that i import the js files only in Index.html
, and i'm not importing also in System.js
or angular-cli.build.js
In Index.html one of the references is:
<script src="assets/js/uploadScript.js"></script>
And this is the code from uploadScript.js
that should open the browser dialog:
$('#drop a').click(function(){
$(this).parent().find('input').click();
});