I've something like below in DOM:
<div ng-if="variant"
ng-include="'size-picker.html'">
</div>
And in controller:
$scope.variant = false;
// after some unknown time there may be:
$scope.variant = true;
I wanted to show that div when variant
is true. So,
$scope.variant
will start by false
. After some time it may/may not become true
. When $scope.variant
became true
it's never gonna change it's value. So what I want is one-time bind that ng-if
once $scope.variant
is true
.
An approach like:
<div ng-if="::variant"
ng-include="'size-picker.html'">
</div>
will stop binding when it's false.
I can achieve it by stop assigning false
to variant
in the first time, but it's not possible in my case.
How can I unbind the ng-if when variant
is true
?