Question

How can we make the following work when we set the input type to file? Here is a fiddle too.

<div ng-app>
    <input ng-model="type" type="radio" value="email" />Email
    <input ng-model="type" type="radio" value="password" />Password
    <input ng-model="type" type="radio" value="file" />File<br/>
        <label>Type:</label> {{ type }}<br/>
    <input type="{{ type }}">
</div>

We can switch dynamically between password, email, and text input types but not into a file type.

We have also tried to set the input type to file from a directive. That also doesn't work.

There is probably a time in the DOM rendering lifecycle after which we can no longer set an input type to file. Can angular set the input type to file before it's to late?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top