Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Expected 1 input.ui-select-search but got '0' UI-Select #1946

Open
naresh217 opened this issue Mar 23, 2017 · 1 comment
Open

Expected 1 input.ui-select-search but got '0' UI-Select #1946

naresh217 opened this issue Mar 23, 2017 · 1 comment
Assignees

Comments

@naresh217
Copy link

I am trying to update "bootstrap/select-multiple.tpl.html" by adding ng-if

var app = angular.module('demo', ['ngSanitize', 'ui.select']);
app.run(["$templateCache",function($templateCache){
  var tmpl = `<div class="ui-select-container ui-select-multiple ui-select-bootstrap dropdown
         form-control" ng-class="{open: $select.open}">
    <div ng-if="true">
        <div class="ui-select-match"></div>
        <input custom-directive enable-format="{{$ctrl.enableMobileNumberFilter}}" type="search" autocomplete="off" autocorrect="off" autocapitalize="off"
               spellcheck="false" class="ui-select-search input-xs"
               placeholder="{{$selectMultiple.getPlaceholder()}}" ng-disabled="$select.disabled"
               ng-click="$select.activate()" ng-model="$select.search" role="combobox" aria-expanded="{{$select.open}}"
               aria-label="{{$select.baseTitle}}" ng-class="{'spinner': $select.refreshing}" ondrop="return false;">
    </div>
    <div class="ui-select-choices"></div>
    <div class="ui-select-no-choice"></div>
</div>`
        $templateCache.put("bootstrap/select-multiple.tpl.html",tmpl);
    }])

I have just added ng-if ="true" (eventually this will replace with actual condition). But it is throwing me an error "Expected 1 input.ui-select-search but got '0'"

It works just fine once we remove ng-if.

Plunker

@Jefiozie
Copy link
Contributor

Hi @naresh217 ,

I think this has to do with the ngIf (seen that issue somewhere else) could you check if the workaround as described here works?

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants