Angularjs - 下拉多选

时间:2015-11-17 12:59:45

标签: angularjs

我正在尝试通过以下方式添加AngularJS多选下拉列表 http://dotansimha.github.io/angularjs-dropdown-multiselect/#/

但我无法得到它..

这是我的Plunker代码

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"}];
})

2 个答案:

答案 0 :(得分:4)

以角度包含模块(即在app.js中) - angularjs-dropdown-multiselect

答案 1 :(得分:0)

您引用的GitHub JS文件不是实际的JS文件,而是显示JS文件的GitHub视图的网页。您需要包含实际的JS文件。

编辑:示例:

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

相关问题