I have my html file game-page-details.component.html
:
<ngx-shimmer-loading *ngIf="!apkDto else appCover" [width]="'100%'" [height]="'100%'"></ngx-shimmer-loading>
<ng-template #appCover>
<img src="assets/media/image/slider-image/slider-1.png">
there
</ng-template>
and my typescript file game-page-details.component.ts
apkDto: ApkDto = null;
ngOnInit(): void {
this.gameId = this.route.snapshot.paramMap.get('gameId');
this.loadApkInfo(Number(this.gameId));
}
private loadApkInfo(apkId: Number) {
// Get the information about the game
const param = { id: Number(apkId)};
this.searchApkController.getApkByIdUsingGET(param).subscribe(
(apkDto) => {
if(apkDto) {
console.log(apkDto);
this.apkDto = apkDto;
}
},
(error) => {
//TODO: if there is an error, we notify the cloudwatch, but show to user that there no notification
});
}
At the end of subscribe request, the apkDto variable is not updated in the front. How could I subscribe the local variable apkDto (without creating external service) so when the request is finished, the variable is updated ?
Thanks.