-
Notifications
You must be signed in to change notification settings - Fork 31
Coffeescript Problems #59
Copy link
Copy link
Open
Description
Hey guys,
First off, this library is totally awesome and also badly needed in the angular community. I'm incredibly happy to see it!
Secondly, I have the following coffeescript model:
angular.module('models').
factory 'Account', [\
"ActiveResource"
(ActiveResource) ->
Account = (data) ->
@number 'id'
@string 'phone_number'
@hasMany 'orders'
Account.inherits ActiveResource.Base
Account.api.set('/accounts').format 'json'
Account
]
Part of the code that makes associations work in your library fails because Account.name returns "" instead of "Account". I can use the class keyword to get the right behavior but that won't survive minification. (I think)
Can you guys support a .className property that gets set explicitly?
For reference here is an example using the name property in your code:
function nameOfBelongsToModel(model) {
if (!model)
return;
if (!model.klass && !model.name)
return;
if (!model.klass)
return model.name.camelize();
return model.klass.name.camelize();
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels