angularjs-dropdown-multiselect
angularjs-dropdown-multiselect copied to clipboard
TypeError: $scope.selectedModel.push is not a function Stack trace:
<div ng-show="inputtype[inputtemplate.id]==true">
<label>Product Line </label>
<div class="selectlabelstyle">
<div id="{{inputtemplate.label+inputtemplate.id}}" ng-dropdown-multiselect="" options="productlines" selected-model="PL+inputtemplate.id" checkboxes="true" extra-settings="example14settings"></div>
</div>
</div>
</div>
I am trying with the above snippet where i am assigning selected-model w.r.t ng-repeat value inputtemplate.id
I generated the scope valriables dynamically as below
var the_string = "PL"+key;//key is values from loop
// Get the model var model = $parse(the_string);
var emptyarray=[];
// Assigns a value to it model.assign(self, emptyarray);
Page is loading with out any issue but when i select a value in multiselect dropdown, getting TypeError: $scope.selectedModel.push is not a function Stack trace: Please help and thanks in advance.
@sunkarareddy selected-model should be Array, Just convert that selected-model as array then your problem will be solved.