2017-05-08 56 views
0

我使用angularjs-dropdown-multiselect指令,但它拋出一個像下面的錯誤。angularjs-dropdown-multiselect指令拋出一個錯誤element.html不是一個函數

類型錯誤:element.html是不是HTMLDivElement.template功能 (angularjs-下拉-multiselect.js:55)

如何解決這個問題?

<div class="container" ng-app="myApp" ng-controller="myController"> 

    <div ng-repeat="item in Items" > 
    <div class="row item-container"> 
     <div class="col-md-4 col-sm-4"> 
      <input ng-model="item.menu" type="text" /> 
     </div> 
     <div class="col-md-4 col-sm-4"> 
      <div ng-dropdown-multiselect="" extra-settings="dropdownSetting" 
        options="options" selected-model="selectedOptions" checkboxes="true"></div> 
     </div> 
     <div class="col-md-3 col-sm-3" > 
      <input type="text" ng-model="item.date" mydatepicker />  
     </div> 

    </div> 
    </div> 
</div> 

腳本

var app = angular.module('myApp', ['angularjs-dropdown-multiselect']); 
    app.controller('myController',function($scope){ 
    $scope.options = []; 
     $scope.selectedOptions = []; 
     $scope.dropdownSetting = { 
      scrollable: true, 
      scrollableHeight: '200px' 
     } 
}); 
+0

請添加一些代碼。 – GhitaB

+0

爲什麼不使用ng-options,因爲它只是一個下拉菜單! – ProblemSolver

+0

請爲這個問題做一個小提琴,它有助於更​​好地理解 –

回答

0
<div class="container" ng-app="myApp" ng-controller="myController"> 

<div ng-repeat="item in Items" > 
<div class="row item-container"> 
    <div class="col-md-4 col-sm-4"> 
     <input ng-model="item.menu" type="text" /> 
    </div> 
    <div class="col-md-4 col-sm-4"> 
     <div multiple ng-options="" ng-model="selectedOptions" checkboxes="true"></div> 
    </div> 
    <div class="col-md-3 col-sm-3" > 
     <input type="text" ng-model="item.date" mydatepicker />  
    </div> 

</div> 


相關問題