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 - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -