0
votes

I am having diffculty injecting this dependency: https://cdnjs.cloudflare.com/ajax/libs/angularjs-dropdown-multiselect/2.0.0-beta.10/src/angularjs-dropdown-multiselect.js into my project.

Here is the dependency injection scheme used in the project:

 angular.module("myModule").controller("myController", MyController);

    function MyController($scope, $window, angular-js-dropdown-multiselect ){
    
    }
     MyController.$inject = ["$scope", "$window", "angular-js-dropdown-multiselect"]

However angular throws a Error: $injector:unpr Unknown Provider error.

I've tried changing angular-js-dropdown-multiselect to angularJsDropdownMultiselect but still see the error.

Any suggestions?

Thanks, Matt

1
It all starts with angular-js-dropdownMultiselect being a syntax errorbaao
Respect JS sintax.Miquel Al. Vicens
fixed the typo on my part. Still have the problem. Thanks!Matthew David Jankowski

1 Answers

1
votes

You're trying to inject a module as opposed to a provider. Include that script on your page and inject whatever providers that module exposes.

Looking at that file, it doesn't expose anything but a directive, so just do something like the following:

JS:

angular.module('yourMoudule', ['angularjs-dropdown-multiselect'])

Usage:

<div dm-dropdown-static-include>...</div>