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)
- Failed to load resource: the server responded with a status of 404 (Not Found)
- Maximum call stack size exceeded error
- How to properly use jsPDF library
- Can I use complex HTML with Twitter Bootstrap’s Tooltip?
- Google Chrome Uncaught (in promise) DOMException while playing AUDIO
- How to get all place details from a Place Details Request using Google Places API Web Service?
- How to make a word underline in Markdown
- SyntaxError: Unexpected token o in JSON at position 1
- ChartJS beginAtZero, min, max doesn’t work
- How do I check whether a checkbox is checked in jQuery?
- how to fix : ” TypeError: Cannot read property ‘addEventListener’ of null”…?//
- Cannot set property InnerHTML of null [duplicate]
- SyntaxError: Unexpected token o in JSON at position 1
- ReferenceError: $ is not defined
- How to fix “Cannot read property ‘addEventListener’ of null” error [duplicate]
- React.js: Set innerHTML vs dangerouslySetInnerHTML
- How do I check whether a checkbox is checked in jQuery?
- jQuery document.createElement equivalent?
- (Google Map API) Geocode was not successful for the following reason: REQUEST_DENIED
- How to make a word underline in Markdown
- Pure JavaScript equivalent of jQuery’s $.ready() – how to call a function when the page/DOM is ready for it [duplicate]
- How to play audio?
- How to play audio?
- How can I scroll to an element using jQuery?
- Reactjs – Form input validation
- jQuery.click() vs onClick
- jQuery Get Selected Option From Dropdown
- Include another HTML file in a HTML file
- Check if checkbox is checked with jQuery
- SyntaxError: Unexpected token o in JSON at position 1
- SyntaxError: Unexpected token o in JSON at position 1
- Add swipe left/right to web page, but use default swipe up/down
- How to add jQuery code into HTML Page
- How can I get the data-id attribute?
- Check if checkbox is checked with jQuery
- How to resolve the C:\fakepath?
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- AngularJS- Login and Authentication in each route and controller
- TypeError: Cannot read property ‘then’ of undefined
- (change) vs (ngModelChange) in angular
- Bootstrap Dropdown menu is not working
- How to Create simple drag and Drop in angularjs
- jquery SlideToggle effect in upward direction?
- Working with $scope.$emit and $scope.$on
- Change Background color (css property) using Jquery
- Failed to load resource: net::ERR_FILE_NOT_FOUND loading json.js
- Get class name using jQuery
- How to clear the canvas for redrawing
- No value accessor for form control
- Adding options to select with javascript
- In angularjs we are having ng-disabled directive, why ng-enabled directive is not provided by the framework as we are having ng-show and ng-hide
- Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser
- Send POST data using XMLHttpRequest
- Set timeout for ajax (jQuery)
- How does the data-toggle attribute work? (What’s its API?)
- Regular expression : match either of two conditions?
- SyntaxError: Unexpected token o in JSON at position 1
- Setting onSubmit in React.js
- CSS height 100% percent not working
- jQuery AJAX submit form
- AngularJS : Factory and Service?
- JavaScript get element by name
- Use images like checkboxes
- How to read xml file contents in jQuery and display in html elements?
- HTML5 Local storage vs. Session storage
- Completely disable scrolling of webpage
- TypeError: Cannot Set property ‘onclick’ of null
- Express Render not working return error: No default engine was specified and no extension was provided
- How do I scroll to an element using JavaScript?
- Give a value to an ng-model=”searchText” input based on list item clicked in Angular JS
- Jquery swipe left or right on mobile
- Programmatically change the src of an img tag
- display variable image using cookies
- How to move an element into another element?
- character counter – backspace doesn’t reflect on characters remaining
- TypeError: Cannot read property ‘get’ of undefined on AngularJS
- Open URL in same window and in same tab
- Create table with jQuery – append
- Error: Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node’
- How to reset a form using jQuery with .reset() method
- Blocked script execution in because the document’s frame is sandboxed – Angular application
- How to convert selected HTML to Json?
- How would I call a javascript function in html?
- How to Open New window on every Click
- Encode HTML entities in JavaScript
- Angular JS Uncaught Error: [$injector:modulerr]
- Use of $parse in angular js
- “.addEventListener is not a function” why does this error occur?