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
this.buyCar = function(id) {
carsSrvc.buyCar(id);
this.cars = carsSrvc.cars; // <====== this one
}
I don't know Angular well but I'd imagine this line might not be a great idea:
this.cars = carsSrvc.cars
(there are actually 2 of that line; it's the same idea for both). You've got a reference to the service's data. The service should probably expose a getter to get a copy of the data. I realize this is not a production app but probably worth starting good habits. Thoughts?
The text was updated successfully, but these errors were encountered:
In Step 3, this line is not needed:
I don't know Angular well but I'd imagine this line might not be a great idea:
(there are actually 2 of that line; it's the same idea for both). You've got a reference to the service's data. The service should probably expose a getter to get a copy of the data. I realize this is not a production app but probably worth starting good habits. Thoughts?
The text was updated successfully, but these errors were encountered: