maccman/spine — Issue #122: Spine.Model.configure without passing string
Author: kossnocorp
Created: 2011-10-24 05:25:59+00:00
State: open

``` coffeescript
class ContactList extends Spine.Model
@configure('ContactList')
```

As you see in example above I was type `ContactList` twice.

In my application I use small trick which exports class to global scope (`window.ContactList` in my case):

``` coffeescript
class ContactList extends Spine.Model
@exports()
```

``` coffeescript
exports = (namespace) ->

root = if namespace?
window[namespace] ?= {}
else
window

root[@name] = @

Spine.Controller.exports = Spine.Model.exports = exports
```

unfortunately this doesn't work in old versions of IE. Anyway we can use dirty trick to cross-browser solution: `ClassName.toString()` or something like that.

What do you think about that? I can make research problem and find good way to implement this.