最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - angular-ui-select control themeing and customizing - Stack Overflow

programmeradmin0浏览0评论

I use Angular UI .

I have a slight issue with my usage of the control. I would like to avoid altogether having a arrow (which seems to allow users to submit the whole form unfortunately). See red circle below:

Here is the corresponding html:

<div class="form-group">
        <label for="address" class="control-label col-lg-3">signup.form.address</label>
        <div class="col-lg-6">
            <ui-select ng-required="true" id="address" name="address" ng-model="signupForm.addressReference"  reset-search-input="false" theme="bootstrap">
                <ui-select-match placeholder="Select address...">{{$select.selected.description}}</ui-select-match>
                <ui-select-choices repeat="address.reference as address in addresses track by $index" refresh="chooseAddress($select.search)" refresh-delay="0">
                    {{address.description }}
                </ui-select-choices>
            </ui-select>
        </div>
        <div ng-messages="signupNgFormCtrl.address.$error" ng-if="signupNgFormCtrl.$submitted" class="col-lg-3">
            <div ng-message="required">required</div>
        </div>
    </div>

Can anyone please help?

Regards,

I use Angular UI https://github./angular-ui/ui-select.

I have a slight issue with my usage of the control. I would like to avoid altogether having a arrow (which seems to allow users to submit the whole form unfortunately). See red circle below:

Here is the corresponding html:

<div class="form-group">
        <label for="address" class="control-label col-lg-3">signup.form.address</label>
        <div class="col-lg-6">
            <ui-select ng-required="true" id="address" name="address" ng-model="signupForm.addressReference"  reset-search-input="false" theme="bootstrap">
                <ui-select-match placeholder="Select address...">{{$select.selected.description}}</ui-select-match>
                <ui-select-choices repeat="address.reference as address in addresses track by $index" refresh="chooseAddress($select.search)" refresh-delay="0">
                    {{address.description }}
                </ui-select-choices>
            </ui-select>
        </div>
        <div ng-messages="signupNgFormCtrl.address.$error" ng-if="signupNgFormCtrl.$submitted" class="col-lg-3">
            <div ng-message="required">required</div>
        </div>
    </div>

Can anyone please help?

Regards,

Share Improve this question edited Jan 23, 2017 at 23:36 Dmitri Zaitsev 14.1k12 gold badges78 silver badges114 bronze badges asked Dec 23, 2014 at 13:27 balteobalteo 24.7k67 gold badges235 silver badges437 bronze badges 1
  • 2 can you please create a plunker for this. – harishr Commented Dec 29, 2014 at 11:33
Add a ment  | 

1 Answer 1

Reset to default 10 +50

All templates are defined at the end of select.js. For instance, this one has class="select2-arrow":

$templateCache.put("select2/match.tpl.html", 
    "<a ...> ... <span class=\"select2-arrow ui-select-toggle\" ng-click=\"$select.toggle($event)\"><b></b></span></a>");

or that one has <span class=\"caret ui-select-toggle\" ng-click=\"$select.toggle($event)\"></span>:

 $templateCache.put("bootstrap/match.tpl.html", ...

Both have ng-click event that might cause the effect you mention. To avoid the arrow or the effect, you can override the template that corresponds to your theme.

发布评论

评论列表(0)

  1. 暂无评论