I am trying to create a dynamic input fields based on a given model.
I want the input elements to have a dynamic type property, but when I do it I get the following exception:
Error: type property can't be changed
I've read that IE doesn't support change of the input type, and therefore angular disallowed it for cross-browser compatibility, but I am sure there is a walkaround in my case, when the input elements are loaded only once and don't change after the first load.
The model:
details: {
serverName: { type: 'text' },
port: { type: 'number' },
nickname: { type: 'text' },
password: { type: 'password' },
channel: { type: 'text' },
channelPassword: { type: 'text' },
autoBookmarkAdd: { type: 'checkbox' }
}
The html code:
<ul>
<li ng-repeat="(index,detail) in communication.details">{{index}}:
<input type="{{detail.type}}" ng-model="detail.value" /></li>
</ul>