Skip to content

Unnecessary line #1

@tylercollier-devmtn

Description

@tylercollier-devmtn

In Step 3, this line is not needed:

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions