Case Sources added primarily to filter the kind of cases in case list.
This commit is contained in:
@ -0,0 +1,28 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { CaseSource } from '../../core/case-source';
|
||||
|
||||
import { CaseSourceListDataSource } from './case-source-list-datasource';
|
||||
|
||||
@Component({
|
||||
selector: 'app-case-source-list',
|
||||
templateUrl: './case-source-list.component.html',
|
||||
styleUrls: ['./case-source-list.component.css'],
|
||||
})
|
||||
export class CaseSourceListComponent implements OnInit {
|
||||
list: CaseSource[] = [];
|
||||
dataSource: CaseSourceListDataSource = new CaseSourceListDataSource(this.list);
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'prefix'];
|
||||
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { list: CaseSource[] };
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new CaseSourceListDataSource(this.list);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user