Good night, I'm trying to get the data in realtime with socketIO, but it does not work. Via console is sending and sending from the backend, but I can not show in the frontend nor does it show any information receiving data.
tickets:any[] = [];//Tentei via Ticket(model) também
ticket:any = {};// tentei só usando ticket;
domain = environment.domain;
private socket;
ngOnInit(): void{
this.ticketService.getTickets().subscribe(data => { this.tickets = data;
this.socket = io(this.domain);
// Receive Added Ticket
this.socket.on('TicketAdded', (data) => {
console.log('TicketAdded: ', (data.ticket));
this.tickets.push(data);
console.log(this.tickets);
})
});
}