ng-if
behavior. if (condition) { ... } else { .... }
ng-if="column.is_available"
. The field type is a string, but there can be several options: function toBoolean(value) { if (typeof value === 'function') { value = true; } else if (value && value.length !== 0) { var v = lowercase("" + value); value = !(v == 'f' || v == '0' || v == 'false' || v == 'no' || v == 'n' || v == '[]'); } else { value = false; } return value; }
false
on lines:ng-extra-if="condition"
, and for the usual ng-if
, use the usual if, the same as in js. <div ng-if="isAvailable(row.is_available)">
$scope.isAvailable = function(is_available){ return !!is_available; }
<div ng-if="!!row.is_available">
ng-hide
and ng-show
.Source: https://habr.com/ru/post/225243/
All Articles