There is a problem with input files in angular see the next fiddle it will help you.
in main controller put this, to give the current scope to your prototype scope:
MyCtrl.prototype.$scope = $scope;
after just include this prototype function
MyCtrl.prototype.setFile = function(element) { var $scope = this.$scope; $scope.$apply(function() { $scope.filename = element.files[0]; }); };
now on input files you can call
onchange="MyCtrl.prototype.setFile(this)"
and it will update the scope 🙂 with will after update the validation on form
Related Posts:
- Angular: mat-form-field must contain a MatFormFieldControl
- Error: ENOENT: no such file or directory, stat ‘/public/main.html’ at Error (native)
- How to pass parameters using ui-sref in ui-router to controller
- How to create a HTML Cancel button that redirects to a URL
- why angularjs ng-repeat not working
- FormData append not working
- JavaScript code to stop form submission
- Unexpected token < in first line of HTML
- ngular is automatically adding ‘ng-invalid’ class on ‘required’ fields
- Can’t Listen to KeyDown in TInyMCE Iframe (jQuery) and Pass it to Parent HTML FORM
- Sending GravityForms to custom HTML
- Failed to load resource: the server responded with a status of 404 (Not Found)
- Can I use complex HTML with Twitter Bootstrap’s Tooltip?
- How to get all place details from a Place Details Request using Google Places API Web Service?
- SyntaxError: Unexpected token o in JSON at position 1
- How do I check whether a checkbox is checked in jQuery?
- SyntaxError: Unexpected token o in JSON at position 1
- (Google Map API) Geocode was not successful for the following reason: REQUEST_DENIED
- Reactjs – Form input validation
- Check if checkbox is checked with jQuery
- Add swipe left/right to web page, but use default swipe up/down
- How can I get the data-id attribute?
- Check if checkbox is checked with jQuery
- How to resolve the C:\fakepath?
- AngularJS- Login and Authentication in each route and controller
- TypeError: Cannot read property ‘then’ of undefined
- Adding options to select with javascript
- How does the data-toggle attribute work? (What’s its API?)
- AngularJS : Factory and Service?
- Use images like checkboxes
- How to read xml file contents in jQuery and display in html elements?
- How do I scroll to an element using JavaScript?
- Programmatically change the src of an img tag
- Error: Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node’
- Angular JS Uncaught Error: [$injector:modulerr]
- How to set the id attribute of a HTML element dynamically with angularjs (1.x)?
- How can I select an element by name with jQuery?
- Using $setValidity inside a Controller
- Full-screen iframe with a height of 100%
- How can I group data with an Angular filter?
- jQuery disable/enable submit button
- Parse an HTML string with JS
- Shortest way to print current year in a website
- DOMException: Failed to load because no supported source was found
- How to submit a form with JavaScript by clicking a link?
- OnChange event handler for radio button (INPUT type=”radio”) doesn’t work as one value
- Partial render in HTML/JavaScript
- Is it possible to append to innerHTML without destroying descendants’ event listeners?
- Why is marquee deprecated and what is the best alternative?
- Refresh/reload the content in Div using jquery/ajax
- Showing an image from an array of images – Javascript
- Embedding instagram webpage inside an iframe
- Set value to currency in
- HTML Entity Decode
- How to connect signalR from angularJs
- Array Mapping in AngularJs
- How can I copy to clipboard in HTML5 without using flash?
- HTML5 rich-text inside textarea
- AngularJS errors: Blocked loading resource from url not allowed by $sceDelegate policy
- How to scroll an HTML page to a given anchor
- How do I check if a cookie exists?
- Highlight a word with jQuery
- how to call a onclick function in tag?
- How do I refresh a DIV content?
- Failed to execute ‘postMessage’ on ‘DOMWindow’: https://www.youtube.com !== http://localhost:9000
- {“error”: “Please use POST request”} – alternative solution to submitting a form
- JavaScript button onclick not working
- jQuery sort elements using data id
- How to redirect to another page using AngularJS?
- HTML make text clickable without making it a hyperlink
- getContext is not a function
- Getting HTML form values
- Change an image with onclick()
- How to run a function when the page is loaded?
- Disabled href tag
- Why is this simple AngularJS ng-show not working?
- Creating Accordion Table with Bootstrap
- Creating Multiple Modals on a Single Page
- Closing Bootstrap modal onclick
- Fire oninput event with jQuery
- window.location() not working, not opening page
- How to clear the canvas for redrawing
- Default text on input
- Calling a JavaScript function in another js file
- JavaScript code not running in HTML5 document
- Javascript, viewing [object HTMLInputElement]
- What is the cause for “angular is not defined”
- $http.get(…).success is not a function
- Why onbeforeunload event is not firing
- How to set “style=display:none;” using jQuery’s attr method?
- WordPress Bootstrap Handburger Menu Wont Open
- Add custom form to theme
- Contact Form 7 – Give each checkbox a class?
- How do you filter the list of states when country is selected? [closed]
- Uncaught ReferenceError: jQuery is not defined – although jQuery is loaded [closed]
- Do I just put the html in a page when enqueueng or do I also have to reference js file from the html page [closed]
- Putting custom html/js page into Elementor as it’s own block
- how to do open a link in a open window from menu bar? [closed]
- Styling parent based on a child element of a child in a WordPress page
- I have custom html mixed with inline javascript that I want added to my WordPress site, how do I achieve this?