I am new to ember, trying to load the data from server below is my script, i am getting the index Cannot read property ‘typeKey’ of undefined TypeError: Cannot read property ‘typeKey’ of undefined error any one help me
Your Menu–Children relationship seems off to me. First, it’s typical to use singular model names; Child in this case. Then, it seems more likely to me that the relationship would look like this:
There are many things that could be wrong, though. You haven’t given us enough information to help. You could make a minimal version of your application on JSBin or the like so we can get the full picture, including the template.
Sorry if I hijack this, but I have the same error in my model.
The thing is I was reading a book and created my model like they did, but I have 2 errors.
I’m using ember-cli:
DEBUG: Ember : 1.7.0
vendor.js:27637 DEBUG: Ember Data : 1.0.0-beta.10
vendor.js:27637 DEBUG: Handlebars : 1.3.0
vendor.js:27637 DEBUG: jQuery : 1.11.1
In my case the category.children is an array of category type objects.
If I comment out the children: hasMany and uncomment children: DS.attr() I don’t see the error anymore, but then I get my second error, when I call inside the template:
{{#each category in categories}}
{{#if category.hasChildren}}
Uncaught TypeError: Cannot read property ‘get’ of undefined.