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

Keeps throwing error Expected 1 .ui-select-match but got '0' #71

Closed
martyphee opened this issue May 30, 2014 · 11 comments
Closed

Keeps throwing error Expected 1 .ui-select-match but got '0' #71

martyphee opened this issue May 30, 2014 · 11 comments

Comments

@martyphee
Copy link

This is being used in a modal popup. I've seen it before, but can't remember how I fixed it. Not sure if it has something to do with the modal or using controlerAs syntax.

http://plnkr.co/edit/UyuPozU95DzvjbOcl8YJ?p=info

 function StudentPollSettingsCtrl($scope, $modalInstance, content, EDITOR_OPTIONS, StudentPollService) {
        this.chartObject = {};

        this.chartType = {};
        this.chartTypes = [
            {
                value: "pie",
                name: "Pie"
            },
            {
                value: "column",
                name: "Column"
            }
        ];
<tab heading="Chart" select="settingsCtrl.updateChart()">
            <div class="row">
                <div class="col-xs-12">
                    <div style="display: inline-block; width: 300px; margin-left: 10px">
                        <ui-select ng-model="settingsCtrl.chartType"
                                   theme="selectize" ng-change="settingsCtrl.updateChart()">
                            <match placeholder="Choose Chart Type">{{$select.selected.name}}</match>
                            <choices repeat="option in settingsCtrl.chartTypes">
                                <div ng-bind-html="option.name"></div>
                            </choices>
                        </ui-select>
                    </div>
                </div>
            </div>
Error: [ui.select:transcluded] Expected 1 .ui-select-match but got '0'.
    at http://0.0.0.0:9000/bower_components/angular-ui-select/dist/select.js:32:12
    at http://0.0.0.0:9000/bower_components/angular-ui-select/dist/select.js:360:17
    at publicLinkFn (http://0.0.0.0:9000/bower_components/angular/angular.js:5890:29)
    at boundTranscludeFn (http://0.0.0.0:9000/bower_components/angular/angular.js:6005:21)
    at controllersBoundTransclude (http://0.0.0.0:9000/bower_components/angular/angular.js:6600:18)
    at link (http://0.0.0.0:9000/bower_components/angular-ui-select/dist/select.js:350:7)
    at nodeLinkFn (http://0.0.0.0:9000/bower_components/angular/angular.js:6579:13)
    at delayedNodeLinkFn (http://0.0.0.0:9000/bower_components/angular/angular.js:6798:11)
    at compositeLinkFn (http://0.0.0.0:9000/bower_components/angular/angular.js:5982:15)
    at compositeLinkFn (http://0.0.0.0:9000/bower_components/angular/angular.js:5989:13) <div class="selectize-control single ng-pristine ng-valid" ng-model="settingsCtrl.chartType.selected" theme="selectize" ng-change="settingsCtrl.updateChart()"> 
@kasperisager
Copy link

<match> and <choice> are supposed to be <ui-select-match> and <ui-select-choice> respectively. Seems like the example in Plunker is outdated 😕

@martyphee
Copy link
Author

Thx, that fixed it of course.

@faisalferoz
Copy link

thanks that fixed it for me as well. The plunker is out dated.

@rvanbaalen
Copy link

So, ui-select-match is required?

@martyphee
Copy link
Author

I updated the plunker with the correct syntax.

http://plnkr.co/edit/UyuPozU95DzvjbOcl8YJ

@Minstel
Copy link

Minstel commented Nov 6, 2014

It seems like syntax is still old, with 'match' and 'choices' tags.

@scottlepp
Copy link

error is back with angular 1.5. updated same plunk as above: http://plnkr.co/edit/FBjraF?p=preview

@codeuniquely
Copy link

went to the link provided http://plnkr.co/edit/FBjraF?p=preview

and got this console error ...

Error: [ui.select:transcluded] Expected 1 .ui-select-match but got '0'.
    at http://run.plnkr.co/Jyc6GTSneCcrkZAF/select.js:32:12
    at http://run.plnkr.co/Jyc6GTSneCcrkZAF/select.js:360:17
    at publicLinkFn (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js:8105:29)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js:8447:29
    at boundTranscludeFn (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js:8244:16)
    at controllersBoundTransclude (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js:9020:20)
    at link (http://run.plnkr.co/Jyc6GTSneCcrkZAF/select.js:350:7)
    at invokeLinkFn (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js:9492:9)
    at nodeLinkFn (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js:8978:11)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js:9231:13 <div class="selectize-control single ng-pristine ng-untouched ng-valid ng-scope" ng-model="settingsCtrl.chartType" theme="selectize" ng-change="settingsCtrl.updateChart()">

@Silur
Copy link

Silur commented Mar 9, 2016

error is back with new syntax 'ui-select-match'

@manveer19188
Copy link

Getting same error "Error: [ui.select:transcluded] Expected 1 .ui-select-match but got '0'." with ui-select version 0.14.1 as using with Angular 1.6.1.

@manveer19188
Copy link

manveer19188 commented Apr 10, 2017

Finally resolved by adding the class ui-select-match and ui-select-choices to

<ui-select-match> and <ui-select-choices>

tags respectively.

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

No branches or pull requests

9 participants