I am looping through a list and displaying buttons.
Within my loop I have job.hasJob. If this is set to 1 then I would like to add a class to the button. The name of the class should be job-block- plus the value of job.hasJobDetails.statusColour
For example, if job.hasJobDetails.statusColour is red then the class name is job-block-red.
If I hard code in the class then it works:
<button ion-button color="dark" [ngClass]="{ 'job-block-red' : job.hasJob == 1}" (click)="changeStatus(job.statuses)" outline>{{ job.jobName }}</button>
But if I try this then I get an error:
<button ion-button color="dark" [ngClass]="{ 'job-block-' + job.hasJobDetails.statusColour : job.hasJob == 1}" (click)="changeStatus(job.statuses)" outline>{{ job.jobName }}</button>
Parser Error: Missing expected : at column 16 in [{ 'job-block-' + job.hasJobDetails.statusColour : job.hasJob == 1}] in BedJobsPage@62:39 ("