Answers for "if statement in angularjs"

0

Angular If else

<div *ngIf="isValid;else other_content">
    content here ...
</div>

<ng-template #other_content>other content here...</ng-template>

<div *ngIf="isValid;then content else other_content">here is ignored</div>
<ng-template #content>content here...</ng-template>
<ng-template #other_content>other content here...</ng-template>

<div *ngIf="isValid;then content"></div>
<ng-template #content>content here...</ng-template>
Posted by: Guest on April-02-2022
0

ng-if

<label>Click me: <input type="checkbox" ng-model="checked" ng-init="checked=true" /></label><br/>
Show when checked:
<span ng-if="checked" class="animate-if">
  This is removed when the checkbox is unchecked.
</span>
Posted by: Guest on February-13-2020

Browse Popular Code Answers by Language