Skip to content

Commit

Permalink
Reorder where the form is reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
DeborahK committed Mar 2, 2018
1 parent fda1768 commit be2c7bb
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions APM-Final/src/app/products/product-edit-info.component.ts
Expand Up @@ -5,23 +5,23 @@ import { NgForm } from '@angular/forms';
import { IProduct } from './product';

@Component({
templateUrl: './app/products/product-edit-info.component.html'
templateUrl: './app/products/product-edit-info.component.html'
})
export class ProductEditInfoComponent implements OnInit {
@ViewChild(NgForm) productForm: NgForm;
@ViewChild(NgForm) productForm: NgForm;

errorMessage: string;
product: IProduct;
errorMessage: string;
product: IProduct;

constructor(private route: ActivatedRoute) { }
constructor(private route: ActivatedRoute) { }

ngOnInit(): void {
this.route.parent.data.subscribe(data => {
this.product = data['product'];
ngOnInit(): void {
this.route.parent.data.subscribe(data => {
if (this.productForm) {
this.productForm.reset();
}

if (this.productForm) {
this.productForm.reset();
}
});
}
this.product = data['product'];
});
}
}

0 comments on commit be2c7bb

Please sign in to comment.