Strict done!!
This commit is contained in:
1 parent
af343cb7f9
commit
afe746ecdc
142 files changed
+1258
-907
No files matched your search
@@ -14,7 +14,7 @@ import { CostCentreService } from '../cost-centre.service';
|
||||
export class CostCentreDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
item: CostCentre;
|
||||
item: CostCentre = new CostCentre();
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
@@ -45,7 +45,7 @@ export class CostCentreDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
ngAfterViewInit() {
|
||||
setTimeout(() => {
|
||||
this.nameElement.nativeElement.focus();
|
||||
if (this.nameElement) this.nameElement.nativeElement.focus();
|
||||
}, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ import { CostCentreListDataSource } from './cost-centre-list-datasource';
|
||||
export class CostCentreListComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
dataSource: CostCentreListDataSource;
|
||||
list: CostCentre[];
|
||||
list: CostCentre[] = [];
|
||||
dataSource: CostCentreListDataSource = new CostCentreListDataSource(this.list);
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'isFixture'];
|
||||
|
||||
@@ -28,6 +28,6 @@ export class CostCentreListComponent implements OnInit {
|
||||
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new CostCentreListDataSource(this.paginator, this.sort, this.list);
|
||||
this.dataSource = new CostCentreListDataSource(this.list, this.paginator, this.sort);
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ const serviceName = 'CostCentreService';
|
||||
export class CostCentreService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
get(id: string): Observable<CostCentre> {
|
||||
get(id: string | null): Observable<CostCentre> {
|
||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||
return <Observable<CostCentre>>(
|
||||
this.http
|
||||
|
||||
Reference in new issue
Block a user