You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using ace with django-angular and I'm facing a problem. The field generated is a div and I get "Unknow field type" from that piece of code in ng-django-forms. (obviously)
return {
restrict: 'A',
// make sure this directive is applied after angular built-in one
priority: 1,
require: ['ngModel', '^?form'],
link: function(scope, element, attrs, ctrls) {
var field = angular.isElement(element) ? element[0] : null;
var modelCtrl = ctrls[0], formCtrl = ctrls[1] || null;
if (!field || !formCtrl)
return;
switch (field.tagName) {
case 'INPUT':
restoreInputField(modelCtrl, field);
break;
case 'SELECT':
restoreSelectOptions(modelCtrl, field);
break;
case 'TEXTAREA':
restoreTextArea(modelCtrl, field);
break;
default:
console.log('Unknown field type');
break;
}
// restore the form's pristine state
formCtrl.$setPristine();
}
};
As it's corner case just for me, should I just patch this or should we provide a way to handle such cases?
The text was updated successfully, but these errors were encountered:
Hey, right now, I've monkey patch this code to add a 'DIV' case with some other stuff. But it's bad. We should provide a way to enable people to add custom field handling without monkey patching the ng-django-forms.js. Do you have any ideas/guidelines how to implement it? I want to do it but I'm not sure how I should start this.
Hi, I'm using
ace
with django-angular and I'm facing a problem. The field generated is adiv
and I get "Unknow field type" from that piece of code in ng-django-forms. (obviously)As it's corner case just for me, should I just patch this or should we provide a way to handle such cases?
The text was updated successfully, but these errors were encountered: