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?

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top