2

I'm having some issues trying to work with the ui-select library. I'm trying to use the select dropdown features but it doesn't work properly.

This is the library used: https://github.com/angular-ui/ui-select

Here's my html code:

<h3>Array of strings</h3>
<ui-select  multiple ng-model="selCountry.selLoc" theme="/resources/ui-select/bootstrap"  ng-disabled="disabled" style="width: 300px;">
    <ui-select-match placeholder="Select locations...">{{$selCountry.selLoc}}</ui-select-match>
    <ui-select-choices repeat="loc in selCountry.locations| filter:$select.search">
        {{loc}}
    </ui-select-choices>
</ui-select>

The error it troughs is : undefined is not a function and it troughs this erro when I click on the ui-selext box.

TypeError: undefined is not a function
    at link (http://localhost:8090/resources/ui-select/select.js:1202:11)
    at H (http://localhost:8090/resources/js/angular-1.2.12.min.js:49:375)
    at f (http://localhost:8090/resources/js/angular-1.2.12.min.js:42:399)
    at H (http://localhost:8090/resources/js/angular-1.2.12.min.js:49:316)
    at f (http://localhost:8090/resources/js/angular-1.2.12.min.js:42:399)
    at http://localhost:8090/resources/js/angular-1.2.12.min.js:42:67
    at http://localhost:8090/resources/js/angular-1.2.12.min.js:43:303
    at A (http://localhost:8090/resources/js/angular-1.2.12.min.js:47:46)

Any advice on what could be the problem?

Thank you

PS

When I click on the select.js error link it takes me to the following piece of code.

 // Recreates old behavior of ng-transclude. Used internally.
  .directive('uisTranscludeAppend', function () {
    return {
      link: function (scope, element, attrs, ctrl, transclude) {
          transclude(scope, function (clone) {
            element.append(clone);
          });
        }
      };
  })

Not sure what is causing that problem as the code is very similar to what the example code is.

4
  • could you post your module initialisation and how you load your scripts? Commented Dec 9, 2014 at 11:04
  • did you remember to add the ui-select module dependency? var app = angular.module('demo', ['ui.select']); Commented Dec 9, 2014 at 11:05
  • yes I did add the ui.select to my app, as a matter of fact I can see the dropdown select. The module initialization is done in the same manner as you suggested in your post above. Commented Dec 9, 2014 at 11:33
  • added some extra code on where the error link goes. Commented Dec 9, 2014 at 12:06

1 Answer 1

1

I just ran into this exact issue. After looking through the comments on the ui-select Github page here, it seems ui-select only works with AngularJS 1.2.18 and higher. I just verified this by upgrading from 1.2.17 to 1.2.18 and the issue is resolved.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.