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

Uncaught TypeError: Cannot read property 'indexOf' of undefined #103

Closed
joshpfosi opened this issue May 14, 2015 · 3 comments
Closed

Uncaught TypeError: Cannot read property 'indexOf' of undefined #103

joshpfosi opened this issue May 14, 2015 · 3 comments

Comments

@joshpfosi
Copy link

Hi, I just did a fresh install of this plugin with

ember 1.12.0
ember-cli 0.2.4
materialize 0.96

and I am following the demo for some of the form components and running into some issues:

Using

    {{md-checks
        selection=checkboxSelections
        content=checkboxChoices
        optionValuePath='id'
        optionLabelPath='label'}}

w/

checkboxChoices: [
  {id: 1, label: "lala"},
  {id: 1, label: "apple"},
  {id: 1, label: "blue"}
]

yields

Uncaught TypeError: Cannot read property 'indexOf' of undefinedindexOf @ ember.debug.js:12019
isValueSelected @ selectable-item-group.js:29get @ selectable-item.js:15
ComputedPropertyPrototype.get @ ember.debug.js:11059get @ ember.debug.js:15588
.
.
.

at console. Any idea why?

@joshpfosi
Copy link
Author

I'm sorry this was my bad. You must initialize the selection as well. Now I can't figure out how to "return" the selection array to the controller

@joshpfosi
Copy link
Author

Can someone point me in the right direction for how this component it to be used? Now if I deselect the items in a particular order an exception is thrown...

@mike-north
Copy link
Owner

@joshpfosi on the off chance that you're still wrestling with this -- you can't have multiple items in the checkboxChoices array with the same id

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

2 participants