javascript - One form by row (fields for every column) with buttons for each: how to manage the dirty state? -
i handle dirty state every single row have in table. unfortunately, adding form around break table, , can't create inside since have field every different column. last column each row contains buttons: delete , update. update appears if 1 of field of row has been made dirty.
somehow, works checking each .pristine every field on row (#name="ngmodel"
). rows created through *ngfor="let row of rows"
. believe better check .dirty
or .pristine
on form rather on every single element.
also, if update, there no way can remove .dirty status (i tried replacing data row removing array , re-adding still dirty).
is there technique go around that?
you use ngmodelgroup around each of rows. can check dirty flag group.
Comments
Post a Comment