I use trying to use ngxs state managment pattern with angular material tables, but I don't know how to do it... Can anyone help?
export class JobsComponent implements OnInit {
public dataSource = new JobsDataSource(this.jobsServise);
//@Select(HomeState.jobs) public jobs$: Observable<boolean>
displayedColumns = ['number', 'date', 'mawb', 'origin', 'destination', 'other'];
constructor(
private jobsServise: JobsService,
private store: Store) {
}
ngOnInit() {
// this.store.dispatch( new GetJobs());
}
}
export class JobsDataSource extends DataSource <any> {
public jobs: IJobs[];
constructor(private jobsServise: JobsService){
super();
}
public connect(): Observable<IJobs[]>{
return this.jobsServise.getJobs();
}
public disconnect(){}
}