如何在 ui-select 内将 ng-if 更改为 ng-show
how to change ng-if to ng-show within ui-select
<div class="form-group">
<label class="col-sm-3 control-label">toys</label>
<div class="col-sm-7">
<ui-select ng-model="VM.editData.toy" theme="selectize">
<ui-select-match><span ng-bind="$select.selected.text"></span></ui-select-match>
<ui-select-choices repeat="item.value as item in (VM.editConfig.toys | filter:$select.search)">
<span ng-bind="item.text"></span>
</ui-select-choices>
</ui-select>
</div>
</div>
我想在选项标签中使用 ng-show 而不是 ng-if,因为我需要 show/hide 这个 dom 而不是删除 it.what 我应该怎么做?
addition:angularjs--1.4.8 ui-select--0.13.2
看看这个 plunkr link..
我刚刚从指令本身更改了它。现在,选项加载了 ng-show,而不是 ng-if..
在项目的附件 select.js(ui-select dist 文件)中,
搜索下划线,
choices.attr('ng-repeat', parserResult.repeatExpression(groupByExp))
.attr('ng-if', '$select.open');
和
<abbr ng-if=\"$select.allowClear && !$select.isEmpty()\"
现在将 ng-if 从那些行更改为 ng-show,
choices.attr('ng-repeat', parserResult.repeatExpression(groupByExp))
.attr('ng-show', '$select.open');
和
<abbr ng-show=\"$select.allowClear && !$select.isEmpty()\"
就是这样!!
<div class="form-group">
<label class="col-sm-3 control-label">toys</label>
<div class="col-sm-7">
<ui-select ng-model="VM.editData.toy" theme="selectize">
<ui-select-match><span ng-bind="$select.selected.text"></span></ui-select-match>
<ui-select-choices repeat="item.value as item in (VM.editConfig.toys | filter:$select.search)">
<span ng-bind="item.text"></span>
</ui-select-choices>
</ui-select>
</div>
</div>
我想在选项标签中使用 ng-show 而不是 ng-if,因为我需要 show/hide 这个 dom 而不是删除 it.what 我应该怎么做? addition:angularjs--1.4.8 ui-select--0.13.2
看看这个 plunkr link..
我刚刚从指令本身更改了它。现在,选项加载了 ng-show,而不是 ng-if..
在项目的附件 select.js(ui-select dist 文件)中,
搜索下划线,
choices.attr('ng-repeat', parserResult.repeatExpression(groupByExp))
.attr('ng-if', '$select.open');
和
<abbr ng-if=\"$select.allowClear && !$select.isEmpty()\"
现在将 ng-if 从那些行更改为 ng-show,
choices.attr('ng-repeat', parserResult.repeatExpression(groupByExp))
.attr('ng-show', '$select.open');
和
<abbr ng-show=\"$select.allowClear && !$select.isEmpty()\"
就是这样!!