disable ngdropdowntoggle in tag html in angular 13

Viewed 26

i have an ngdropdownmenu , and I just want to "disable/enable" 'ngdropdowntoggle' by a condition .. if condition --> add ngdropdowntoggle

this is my code :

<button class="btn btn-outline-primary" type="button" ngbDropdownToggle> 
   {{buttonItem.titlee}}
 </button>
1 Answers

For your current case :

<button *ngIf="condition" class="btn btn-outline-primary" type="button" ngbDropdownToggle> 
   {{buttonItem.titlee}}
</button>

<button *ngIf="!condition" class="btn btn-outline-primary" type="button"> 
  {{buttonItem.titlee}}
</button>

For your custom directive you use structural directive like this :

<p *appUnless="condition" class="unless a">
  (A) This paragraph is displayed because the condition is false.
</p>
Related