backbone.syphon icon indicating copy to clipboard operation
backbone.syphon copied to clipboard

deserialize doesnt appear to accept a model

Open mark-lester opened this issue 9 years ago • 8 comments

I cant go Syphon.deserialize(view,model); Is there a reason for that ?

mark-lester avatar Nov 30 '15 19:11 mark-lester

what would you expect that api call to do?

samccone avatar Nov 30 '15 19:11 samccone

I think he means Syphon.deserialize(view, model.toJSON()). Could be cool if the lib did that automatically.

happylinks avatar Nov 30 '15 20:11 happylinks

Ah right, you go toJSON(), yes of course. OK, I accept anyone who hasnt just landed should know how to do that.

mark-lester avatar Nov 30 '15 20:11 mark-lester

sure that would be nice, if the item passed implements a toJSON method we call that otherwise we treat it like a regular object :)

@mark-lester @happylinks any interest in opening up a PR?

samccone avatar Nov 30 '15 20:11 samccone

yes sure

mark-lester avatar Nov 30 '15 20:11 mark-lester

oh ok, well, i will get my formgen working, then if nothing happens on this I will do the biz. it confused me, it would be nice to go deserialize(this,this.model)

mark-lester avatar Nov 30 '15 20:11 mark-lester

Ah sorry, spoke before my turn :) if you want help/me to do it, let me know.

happylinks avatar Nov 30 '15 20:11 happylinks

I will do,

mark-lester avatar Nov 30 '15 21:11 mark-lester