2

I am trying to add an AngularJS multi select drop down by following http://dotansimha.github.io/angularjs-dropdown-multiselect/#/

But I am not able to get it..

Here is my Plunker code

http://plnkr.co/edit/7EV9Fc?p=preview

HTML:-

<!DOCTYPE html>
<html>

  <head>
    <link rel="stylesheet" href="style.css">
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js"></script>
    <script src="https://github.com/dotansimha/angularjs-dropdown-multiselect/blob/master/src/angularjs-dropdown-multiselect.js"> </script>
    <script src="https://github.com/lodash/lodash/blob/master/dist/lodash.js"></script>
    <script src="script.js"></script>
  </head>

<body ng-app="jayApp" ng-controller='jayController'>

Drop down : 
    <div ng-dropdown-multiselect="" options="example1data" selected-model="example1model">

    </div>

</body>

</html>

Javascript

var jayApp = angular.module('jayApp',[]);

jayApp.controller('jayController', function($scope) {

    $scope.example1model = []; 
    $scope.example1data = [ {id: 1, label: "David"}, {id: 2, label: "Jhon"}, {id: 3, label: "Danny"}];
})

3 Answers 3

4

Include the module in angular (i.e. in app.js) - angularjs-dropdown-multiselect

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

Comments

1

The GitHub JS files you are referencing are not the actual JS files but the web page that shows the GitHub view of the JS file. You need to include the actual JS files.

Edit: Example:

https://github.com/dotansimha/angularjs-dropdown-multiselect/blob/master/src/angularjs-dropdown-multiselect.js

vs.

https://raw.githubusercontent.com/dotansimha/angularjs-dropdown-multiselect/master/src/angularjs-dropdown-multiselect.js

Comments

0
var myApp = angular.module("yourAppName", [ "angularjs-dropdown-multiselect" ])

You need to register the module to your app.

Your path to the script was also wrong (as mentioned by another user).

I know this is 4 years too late, but hopefully this helps anyone else still using the ancient AngularJS.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.