I have created function and inside function i\'m calling one callback function after callback response I have update string variable but this string variable not updating my vie
The callback logic should be run within Angular Zone.
import { Component, NgZone } from '@angular/core';
@Component({
selector: "myview"
templateUrl: 'app/view/myview.component.html'
})
export class ViewComponent {
getAddress: string;
public totalBalance: string;
constructor(private ngZone: NgZone) {}
getBalance(): void {
getBalanceData(this.getAddress, (error, result) => this.ngZone.run(() => {
console.log(result);
this.totalBalance = result;
}));
}
}