How do you clear form inputs when a model changes in AngularJS? -


i have form has common inputs , inputs specific model 'type'. when user selects 'type', select dropdown, these specific fields change. i'm using ng-include include specific 'partial' based on model.type. in 'edit' mode, how can reset these specific inputs when model 'type' changes?

use ng-change property on select.

then tie function clears models bound form inputs (e.g. sets '').

jsfiddle


Comments

Popular posts from this blog

javascript - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -