Once a user submits an object through a form, I want the form to reset so they can add another entry. I've attempted to use $setPristine() but am struggling with the syntax. Currently, I have resorted to redirecting back to the same page, which doesn't achieve the desired reset. I'm also unsure if using $setPristine is the correct approach. Below is my save function:
export class AddCarController {
public newCar;
public save() {
this.carService.save(this.newCar).then(() => { this.$location.path('/addCarPage') });
}
constructor(
private carService: MyApp.Services.CarService,
private $location: angular.ILocationService
) { }
}