Strict done!!
This commit is contained in:
@@ -18,9 +18,9 @@ import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dial
|
||||
export class AccountDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
accountTypes: AccountType[];
|
||||
costCentres: CostCentre[];
|
||||
item: Account;
|
||||
accountTypes: AccountType[] = [];
|
||||
costCentres: CostCentre[] = [];
|
||||
item: Account = new Account();
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
@@ -68,7 +68,7 @@ export class AccountDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
ngAfterViewInit() {
|
||||
setTimeout(() => {
|
||||
this.nameElement.nativeElement.focus();
|
||||
if (this.nameElement) this.nameElement.nativeElement.focus();
|
||||
}, 0);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export class AccountDetailComponent 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('/accounts');
|
||||
|
||||
Reference in New Issue
Block a user