I am working on Angular - Node websockets, scenario is when the button is clicked, it will be sending a request to server and get data and update the received data on client-side. but it is not changing as per. code is below.
Label on component HTML
<h2>{{iSpeed}}</h2>
component.ts
iSpeed: any;
//BUTTONCLICK
speedTest(){
//WORKS
this.iSpeed = "LOADING";
socket.emit("checkedTrue");
}
ngOnInit(): void {
socket.on('acknowledged', (data: any) =>{
//LABEL CHANGE
this.iSpeed = data.internetSpeed;
alert(this.intSpeed = data.internetSpeed);
})
}
Angular Newbie, where I am being dumb?