37 lines
989 B
TypeScript
37 lines
989 B
TypeScript
import { Component, Input } from '@angular/core';
|
|
import { CommonModule } from '@angular/common';
|
|
import { WebsocketService } from '../../service/websocket.service'; // adjust path if needed
|
|
|
|
@Component({
|
|
selector: 'app-shared-table',
|
|
standalone: true,
|
|
imports: [CommonModule],
|
|
templateUrl: './shared-table.component.html',
|
|
styleUrls: ['./shared-table.component.css']
|
|
})
|
|
// export class SharedTableComponent {
|
|
// @Input() summaryRows: any[] = [];
|
|
// @Input() rows: any[] = [];
|
|
// @Input() totalAmount: string = '';
|
|
// }
|
|
export class SharedTableComponent {
|
|
@Input() summaryRows: any[] = [];
|
|
@Input() rows: any[] = [];
|
|
@Input() totalAmount: string = '';
|
|
|
|
message = '';
|
|
isConnected = false;
|
|
|
|
constructor(private websocketService: WebsocketService) {}
|
|
|
|
ngOnInit() {
|
|
this.websocketService.message$.subscribe(msg => {
|
|
this.message = msg;
|
|
});
|
|
|
|
this.websocketService.isConnected$.subscribe(status => {
|
|
this.isConnected = status;
|
|
});
|
|
}
|
|
}
|