cpu2007
cpu2007

Reputation: 965

ui-select angularjs bootstrap undefined is not a function error

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.

Upvotes: 2

Views: 1404

Answers (1)

Fiver
Fiver

Reputation: 10167

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.

Upvotes: 1

Related Questions