-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathcustomer-list.component.ts
32 lines (28 loc) · 1.06 KB
/
customer-list.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Component, OnInit } from '@angular/core';
import { Subject } from 'rxjs';
import { DrestaurantCustomerService, CustomerListDataSource, EventManager } from '@d-restaurant-frontend/drestaurant-shared';
import { PageEvent } from '@angular/material';
import { StompService } from '@stomp/ng2-stompjs';
@Component({
selector: 'd-restaurant-frontend-customer-list',
templateUrl: './customer-list.component.html',
styleUrls: ['./customer-list.component.scss']
})
export class CustomerListComponent implements OnInit {
dataSource: CustomerListDataSource;
pageChange: Subject<PageEvent>;
constructor(private customerService: DrestaurantCustomerService, private eventManager: EventManager, private stompService: StompService) { }
ngOnInit() {
this.pageChange = new Subject();
this.dataSource = new CustomerListDataSource(
this.customerService,
this.pageChange,
this.eventManager,
this.stompService
);
}
pageChanged(pageEvent: PageEvent) {
/** Sending 'page event' to the stream */
this.pageChange.next(pageEvent);
}
}