Strict done!!

This commit is contained in:
2020-11-23 16:42:54 +05:30
parent af343cb7f9
commit afe746ecdc
142 changed files with 1258 additions and 907 deletions

View File

@ -17,8 +17,8 @@ import { ProductService } from '../product.service';
export class ProductDetailComponent implements OnInit, AfterViewInit {
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
form: FormGroup;
productGroups: ProductGroup[];
item: Product;
productGroups: ProductGroup[] = [];
item: Product = new Product();
constructor(
private route: ActivatedRoute,
@ -73,7 +73,7 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
ngAfterViewInit() {
setTimeout(() => {
this.nameElement.nativeElement.focus();
if (this.nameElement) this.nameElement.nativeElement.focus();
}, 0);
}
@ -90,7 +90,7 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
}
delete() {
this.ser.delete(this.item.id).subscribe(
this.ser.delete(this.item.id as string).subscribe(
() => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/products');