Last active
December 17, 2015 23:48
-
-
Save psykidellic/5691551 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SomeModel = Backbone.Model.extend( | |
| ) | |
| ... | |
| @collection.each((model) -> | |
| console.log model.get('foo') # Returns correctly | |
| bar = new SomeModel(model) | |
| console.log bar.get('foo') # Returns undefined - previously x.get('foo') returned correct too | |
| # So now I have to do | |
| baz = new SomeModel(model.attributes) | |
| baz.get('foo') # works now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't understand why you need
barorbazwhenmodelalready does what you seem to want?