Can you please tell me why my value in the html does not change when my variable gets updated? This is my code in the ts
private peer: any;
private anotherId: 'opopo'
public myPeerId: '123456';
ngOnInit(): void {
this.peer = new Peer();
this.peer.on('open', function (connectionId) {
this.myPeerId = connectionId;
console.log(this.myPeerId)
});
}
I can log my variable value when it changes but somehow, my html does not. Please see my html code
<h1>My id - {{myPeerId}}</h1>
<input type="text" [(ngModel)]="anotherId" >
<button (click)="connect()">Connect</button>
Thank you.