I currently have an if condition set up where if the API call returns 0, the button to proceed to the next page should be disabled. However, I am unsure of how to achieve this as you are not able to call a method within another method. Here is my current setup:
HTML:
<button type="button" class="primary-button mat-raised-button buttontxt" (click)="next()">Next</button>
TS:
ngOnInit(): void {
this.appService.showLoader(true);
this.coachService.GetCategories().subscribe(res =>
{
if (res && res.length === 0){
this.appService.openSnackBar('You do not have access to this Service');
//This line is where I thought to call this method to disable the button
this.next = [disabled];
} else if (res && res.length === 1) {
if( res[0].name === 'pageOne'){
//irrelevant code }
//Button
nextMindset(){
//route to pageOne
}