在我的模板中,我有:
<div ng-if="$ctrl.show()">
<input class="form-control" type="text">
</div>
在我的组件中
show() {
if (angular.isDefined(this.parking.parkingType)) {
return this.parking.parkingType.labelKey === 'parking_type.air'
}
}
我希望仅在单击属性的选择输入(ui-select)时才处理函数on-select="$ctrl.show()"
:
<ui-select ng-model="$ctrl.parking.parkingType"
on-select="$ctrl.show()">
<ui-select-match allow-clear="true">
<span>{{ $select.selected.label }}</span>
</ui-select-match>
<ui-select-choices repeat="item in $ctrl.parkingType | filter: { label: $select.search }">
<span ng-bind-html="item.label"></span>
</ui-select-choices>
</ui-select>
此案例可能类似于以下示例案例:仅在单击ng-click