I'm trying to create an upload button.
HTML
<div class="parent">
<input id="uploadFile" type="file" ng-model="uploadFile">
<div class="child">
<span>select a file</span>
</div>
</div>
JS
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.$watch('uploadFile', function(val) {
if (val) {
console.log(val);
}
});
}
So I have hidden default input type file by adding some opacity in CSS and what I need is to take the value from the input type file and replace the span value with the value from input, also need an "x" close button that will delete the span and input value.