Tom
Tom

Reputation: 8681

Setting the disabled property based either of the two boolean variables

I am currently trying to set the disabled property to true or false based on value of a flag in my angular 7 application. How do I set the value based on either of the two flags as it is giving me a runtime error

As you can see below I am assigning the following

   [disabled] =  CanEditManagerStrategy

Code

 <div *ngIf="EditMode[f.LegalFundClassCommercialViewModel.Id]">
        <button type="button" class="btn btn-default btn" style="float: left;"
               [disabled] =  CanEditManagerStrategy
               (click)="reviewClicked(f.LegalFundClassCommercialViewModel.Id,1)">Review
                                                Terms</button>
             <div style="float: left; margin: 5px;">
                       {{f.LegalFundClassCommercialViewModel.AuditSummary}}
            </div>
  </div>

I need to check against two values and trying the following which is giving an error

 [disabled] =  CanEditManagerStrategy || CanEdit 

Upvotes: 0

Views: 710

Answers (1)

Hien Nguyen
Hien Nguyen

Reputation: 18975

Wrap it with "" , tried to reproduce

https://stackblitz.com/edit/angular-ri29rm

[disabled] = "CanEditManagerStrategy || CanEdit"

Upvotes: 1

Related Questions