我经常尝试将ngxs状态管理模式与角形材料表一起使用,但我不知道该怎么做...有人可以帮忙吗?
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(){}
}