I have an array to store the alerts to display.
appLevelAlert
const alert = {
message: 'Your account is not activated.'
+ ' Select the link in your email inbox to activate your account',
actionName: 'Resend Email',
action: 'resendEmail()'
};
this.appLevelAlert = this.appLevelAlert || [];
this.appLevelAlert.push(alert);
I would like to assign the resendEmail() in appLevelAlert.action to the (Click) of a button.
<clr-alert [clrAlertType]="'info'" [clrAlertAppLevel]="true" *ngFor='let alert of clarityAlertService.appLevelAlert'>
<clr-alert-item>
<span class="alert-text">
{{alert.message}}
</span>
<div class="alert-actions">
<button class="btn alert-action" (click)="[alert.action]">{{alert.actionName}}</button>
</div>
</clr-alert-item>
I'm not sure if this is possible, can anyone help me on this?