Search
 
SCRIPT & CODE EXAMPLE
 

HTML

display element with ng-template

<!-- How to display one element with ng-template (also applies to one or more elements) -->

<div class="button-group">
  <ng-template [ngIf]="tableSettings.selection.selected.length > 0">
        <button mat-button
          class="mat-button"
          (click)="callMethod()">
          Chop Fruit
        </button>
      </ng-template>
   <button mat-button>Some other element</button>
</div>

<!-- The below will NOT work: -->
<!-- ngIf must be in ng-template in order to work properly -->

<div class="button-group">
  <ng-template>
        <button mat-button
          *ngIf="tableSettings.selection.selected.length > 0"
          class="mat-button"
          (click)="callMethod()">
          Chop Fruit
        </button>
      </ng-template>
   <button mat-button>Some other element</button>
</div>
Comment

PREVIOUS NEXT
Code Example
Html :: how to select every element except first 
Html :: expo webview local html 
Html :: documentformat.openxml bold text 
Html :: tailwind danger text 
Html :: can you stop prettier from line wrapping html 
Html :: make an drodown menu 
Html :: twig last item 
Html :: html ul 
Html :: navigate to a html link in django python 
Html :: html5 input types 
Html :: venobox cdn 
Html :: composer require kyslik/column-sortable 
Html :: Hide overflow for Absolute images 
Html :: how to add bootstrap carousel 
Html :: ionic footer not appearing 
Html :: bold text html 
Html :: html frame 
Html :: possible colors used for html 
Html :: data tables in html 
Html :: xhtml 
Html :: status code 201 
Html :: how to do comment in html 
Html :: disable submit button after form validation 
Html :: srcset 
Html :: html text next line 
Html :: extract html from website 
Html :: disabling cach using meta tag 
Html :: how to format vue html with prettier 
Html :: i = ["hi", "he", 
Html :: cambiar valor de atributo colspan jquery 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =