skip to Main Content

I found this cool library to do dropdown menus with + , here:
http://dotansimha.github.io/angularjs-dropdown-multiselect/docs.

I am following the examples, I have this in my :

<div ng-dropdown-multiselect="" options="stringData" selected-model="stringModel" extra-settings="stringSettings">
</div>

And this in my controller:

$scope.stringData = ['a', 'b', 'c'];

$scope.stringModel = [];

$scope.stringSettings = {
  template: '{{option}}',
  smartButtonTextConverter: function(skip, option) {
    return option;
  },
};

And yet, absolutely nothing is being rendered to the page. 🙁

Anybody have any idea what might be wrong?

I have , and loaded in this order:

<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="lib/angular/angular.js"></script>
<script type="text/javascript" src="lib/angularjs-dropdown-multiselect/dist/src/angularjs-dropdown-multiselect.js"></script>

2

Answers


  1. When I add the dependency here:

    angular.module('app', ['ui.router', 'ngAnimate', 'ngSanitize', 'ngDropdownMultiselect']);
    

    I get this error:

    jquery.min.js:2 Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
    Error: [$injector:modulerr] Failed to instantiate module ngDropdownMultiselect due to:
    Error: [$injector:nomod] Module 'ngDropdownMultiselect' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
    http://errors.angularjs.org/1.6.1/$injector/nomod?p0=ngDropdownMultiselect
    

    So I checked the docs (again), and it says to use this instead

    angular.module('app', ['ui.router', 'ngAnimate', 'ngSanitize', 'angularjs-dropdown-multiselect']);
    

    now it “works”

    ughh, gotta love front-end development lol

    Login or Signup to reply.
  2. var app = angular.module('app', [
        'ngAnimate',
        'ui.select',
        'ngSanitize',
        'ui.router',
        'ui.bootstrap',
        'ui.jq',
        'app.directive.voucherView',
        'abp'
    ]).filter('angularjs-dropdown-multiselect', function () { });
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search