How to Access Value Outside Subscribe Method
public ttl_count = 0;
ngOnInit() {
this.MacService.getAllCouseCount().subscribe((res)=> {
this.ttl_count = res['count']
});
}
Whenever I console.log(this.ttl_count) within the subscribe function I get the right result but whenever I log it outside the subscribe function I get 0