angular-selectize
angular-selectize copied to clipboard
ng-show and ng-hide not working in <selectize> element
I experienced this when conditionally disabling/enabling the selectize element with Angular's ng-show and ng-hide directives. It is only working when wrapping the whole thing with a dummy div. See my code for reference:
<!-- Not working -->
<selectize ng-show="availableTags.length > 0" config='selectizeOptions' options="availableTags" ng-model="tags" ></selectize>
<!-- working -->
<div ng-show="availableTags.length > 0">
<selectize config='selectizeOptions' options="availableTags" ng-model="tags" ></selectize>
</div>
I want to point out that the desired behaviour can be simulated with the ng-ifdirective:
<selectize ng-if="availableTags.length > 0" config='selectizeOptions' options="availableTags" ng-model="tags" ></selectize>