Angular + jQuery: Error: type property can't be changed

1,397 views
Skip to first unread message

Dmitry

unread,
Aug 28, 2012, 11:09:26 AM8/28/12
to ang...@googlegroups.com

Hi
I have very strange error:  Error: type property can't be changed when I'm trying to display a form based on model. inside my view I analyze what kind of field I have and display input, radio .. etc.

it based on this example: http://jsfiddle.net/ProLoser/bp3Qu/light/


I think there already an issue registered in GitHub: https://github.com/angular/angular.js/issues/1114

Does anyone find same behaviour, and maybe someone know how to workaround it ?

Thank you.

Dmitry

unread,
Aug 29, 2012, 8:05:37 AM8/29/12
to ang...@googlegroups.com
Looks like this is not jquery problem

I had the following
<input ng-switch-default type="{{field.inputType}}" ng-model="field.value" ng-bind-attr="{required:'{{field.required}}'}" value="{{field.value}}" placeholder="{{field.placeholder}}"  class="input-medium"  ui-event="{ blur : 'changeScopeState()' }">


and looks like angular complain about dynamic TYPE changing.

I've replaced this with two lines, without dynamic type, like
<span ng-switch-default>Invalid input type: {{field.inputType}}</span>
<input ng-switch-when="text" type="text" ng-model="field.value" ng-bind-attr="{required:'{{field.required}}'}" value="{{field.value}}" placeholder="{{field.placeholder}}" class="input-medium" ui-event="{ blur : 'changeScopeState()' }">


and everything works.


Not sure is this is a bug, perhaps someone from community should decide this.
 

Matjaž Lipuš

unread,
Jul 19, 2013, 12:11:06 PM7/19/13
to ang...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages