Wednesday, June 7, 2017

no name or id setting on controls inside of a *ngFor

You really don't need that stuff. You may just have events or even the [(ngModel)] trick doctor up stuff on the immediate object in the collection. A save button event may then just take the collection and do whatever dirty checking you need to do to save off that which has changed. You may find yourself doctoring base objects with inheritance to add dupe getsetters for what a value was versus what it might be (for dirty checking) or the range a numeric value may become (for sanity checking), etc. Don't let the old ways bleed into the new out of habit. You don't want an unholy hodgepodge of two dissimilar things. It won't make sense.

No comments:

Post a Comment