backbone.js - How to share model between modules -


i trying develop backbone marionette application. need able edit model have no idea how model edit form.

i using modules each "responsibility" in app. example 1 module listing users , 1 handling editing users.

what best way of sharing model between list module , edit module? need support both opening edit form programatically , route.

thankful regarding crud marionette in general too.

i'd suggest reconsider separating "list" , "edit" tasks separate modules. think of module family of related features constitute single deliverable. ever edit user without out listing users? not likely.

separation of concerns important, separation can still occur within module. example, you've identified @ least 4 different things, each own responsibilities, related 'user':

userlistview -> collectionview useritemview -> itemview usereditview -> layout or itemview usercontroller -> controller userrouter -> approuter 

start simple: create module userlistview , useritemview, backbone.collection, , backbone.model. when have fetched collection, create , show in collectionview.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -