Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angularjs How to render either a number or a HTML element depending on what a function returns

//AngularJS

//ng-if

<span ng-If="assessmentRequestValue">{{ assessmentRequestValue }}</span>
<span ng-If="!assessmentRequestValue"><i class="icon ion-checkmark"></i></span>

//Angular2+

//NgIf

<span *ngIf="assessmentRequestValue">{{ assessmentRequestValue }}</span>
<span *ngIf="!assessmentRequestValue"><i class="icon ion-checkmark"></i></span>
 
PREVIOUS NEXT
Tagged: #angularjs #How #render #number #HTML #element #depending #function #returns
ADD COMMENT
Topic
Name
3+7 =