javascript - Setting input type="file" using AngularJS expression not working in Chrome -


i working on form builder application in angular , have run odd bug in chrome. dynamically setting form input type based on variable. seems work input types except "file", change "text" in chrome. simple example below:

<div ng-app="app">   <input type="{{'file'}}" /><br />   <input type="{{'color'}}" /><br />   <input type="{{'button'}}" value="button" /> </div> 

jsfiddle

indeed, sounds bug, can bypass using ngattr:

<input ng-attr-type="{{'file'}}" /> <input ng-attr-type="{{'color'}}" /> <input ng-attr-type="{{'button'}}" value="button" /> 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -