Skip to content

Instantly share code, notes, and snippets.

@psykidellic
Last active December 17, 2015 23:48
Show Gist options
  • Select an option

  • Save psykidellic/5691551 to your computer and use it in GitHub Desktop.

Select an option

Save psykidellic/5691551 to your computer and use it in GitHub Desktop.
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
@bewest

bewest commented Jun 1, 2013

Copy link
Copy Markdown

I don't understand why you need bar or baz when model already does what you seem to want?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment