Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: values.map is not a function #40

Open
sumeetmobiwebtech opened this issue Jun 15, 2018 · 2 comments
Open

TypeError: values.map is not a function #40

sumeetmobiwebtech opened this issue Jun 15, 2018 · 2 comments

Comments

@sumeetmobiwebtech
Copy link

sumeetmobiwebtech commented Jun 15, 2018

How to solve this ?

i am using this 

<md-input-container>     
               <label for="name">Accounts:</label>    
               <select chosen multiple options="accountListData" on-change="doStuff"
                   ng-model="incomeFilters.account"
                   ng-options="ald.accountID as ald.accountHolderName for ald in accountListData" class="form-control">
               </select>
            </md-input-container>

But Getting this error in console after select------

angular.js:14700 TypeError: values.map is not a function
    at SelectController.writeNgOptionsMultiple [as writeValue] (angular.js:30513)
    at Object.ngModelCtrl.$render (angular.js:33327)
    at selectMultipleWatch (angular.js:33300)
    at Scope.$digest (angular.js:18253)
    at Scope.$apply (angular.js:18531)
    at HTMLButtonElement.<anonymous> (angular.js:27346)
    at HTMLButtonElement.dispatch (jquery.min.js:4)
    at HTMLButtonElement.r.handle (jquery.min.js:4)
@adityasharat
Copy link
Owner

can you share accountListData as a JSON here?

@ShindeSwapnali
Copy link

ShindeSwapnali commented Aug 4, 2019

I am also getting the same error

HTML

                    <div ng-dropdown-multiselect="" options="myDropdownOptions " selected-model="myDropdownModel" extra-settings="myDropdownSettings" checkboxes="true" ></div>

$scope.myDropdownOptions = [{
id: "S",
label: "Standard"
}, {
id: "I",
label: "Intermediate"
}, {
id: "B",
label: "Best available"
}];
$scope.myDropdownModel = [$scope.myDropdownOptions[0]];

$scope.myDropdownSettings = {
    styleActive: true,
    checkBoxes: true,
    smartButtonTextProvider(selectionArray) {
        if (selectionArray.length === 1) {
            return selectionArray[0].label;
        } else {
            return selectionArray.length + ' Selected';
        }
    }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants