FacultyCreative / ngActiveResource

Connects business objects and REST web services for Angular.js
255 stars 34 forks source link

Uncaught TypeError: Cannot read property 'downcase' of undefined #66

Closed tijhaart closed 10 years ago

tijhaart commented 10 years ago

I'm trying to recreate the Post/Comment sample in a codepen but I'm getting the error "Uncaught TypeError: Cannot read property 'downcase' of undefined". And I can't find the cause. I want to know if i'm doing something wrong?

The error happens on line 278 in active-support.js because the string is empty (""). I think it has something to do with the relations because when I comment out this.hasMany('comments') the error doesn't occur.

tijhaart commented 10 years ago

I've found the issue with the TypeError. It had to do with defining the model with an anonymous function like this var Post = function(data) {} which is similar to #59.