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

Error thrown with latest dist using example code #64

Closed
WhatFreshHellIsThis opened this issue May 14, 2014 · 2 comments
Closed

Error thrown with latest dist using example code #64

WhatFreshHellIsThis opened this issue May 14, 2014 · 2 comments

Comments

@WhatFreshHellIsThis
Copy link

[UPDATE: MY OWN FAULT, SEE BELOW]
I've run into the name collision issue here and have tried to fix it myself but then discovered there is a new dist from my last one so I just confirmed it has the new prefix ui-select on match and choices so I thought I was home free but...nope.

It appears to work as it's supposed to at a rough first trial with it, however:

This error is thrown with the latest select.js and select.css downloaded from /dist about 10 minutes ago:

Error: [ui.select:transcluded] http://errors.angularjs.org/1.2.14/ui.select/transcluded?p0=Expected%201%20.ui-select-match%20but%20got%20'%7B0%7D'.&p1=0

I just copied the exact example from /examples/bootstrap.html pasted here for convenience:

 <div class="form-group">
    <label class="col-sm-3 control-label">Default</label>
    <div class="col-sm-6">

      <ui-select ng-model="person.selected" theme="bootstrap">
        <ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
        <ui-select-choices repeat="item in people | filter: $select.search">
          <div ng-bind-html="item.name | highlight: $select.search"></div>
          <small ng-bind-html="item.email | highlight: $select.search"></small>
        </ui-select-choices>
      </ui-select>

    </div>
  </div>

And this is the area of code throwing the error:

 var transcludedMatch = transcluded.querySelectorAll('.ui-select-match');
    if (transcludedMatch.length !== 1) {
      throw uiSelectMinErr('transcluded', "Expected 1 .ui-select-match but got '{0}'.", transcludedMatch.length);
    }
    element.querySelectorAll('.ui-select-match').replaceWith(transcludedMatch);

Clearly there is a ui-select-match so...? (I'm using jquery-2.0.3 if that has any bearing on this)

@WhatFreshHellIsThis
Copy link
Author

I'm an idiot! I had reverted a page and so it went back to the old <match and <choices tags not the new <ui-select-match and <ui-select-choices which should have been obvious from the error. Leaving this here in case it helps others.

@Dealize
Copy link

Dealize commented Aug 19, 2015

昨天刚碰到同样的问题,然后也是第二天无意间解决了。
在使用ui-select时候,在ui-select-choices中的peopel 先要在后台初始化
people=[];(试过赋值为“”、{}都会报错)

hiersekornc pushed a commit to hiersekornc/ui-select that referenced this issue Jan 15, 2016
`$stateParams` is now a service with an `$observe()` method to watch parameters on dynamic state parameters. Dynamic state parameters can be declared like so: `params: { foo: { dynamic: true } }`.

Closes angular-ui#1037, angular-ui#1038, angular-ui#64
hiersekornc pushed a commit to hiersekornc/ui-select that referenced this issue Jan 15, 2016
`$stateParams` is now a service with an `$observe()` method to watch parameters on dynamic state parameters. Dynamic state parameters can be declared like so: `params: { foo: { dynamic: true } }`.

Closes angular-ui#1037, angular-ui#1038, angular-ui#64
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

2 participants