You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know in order to iterate over backbone collection adapter returns internal array instead of collection. That really annoying for cases when you need collection, for example when you pass it as parameter to component (as attribute)
So, I suggest to move such decision to configuration option:
rivets.adapters[':'].returnCollection=true;// and inside rivets-backbone.jsif(!rivets.adapters[':'].returnCollection&&valueinstanceofCollection){returnvalue.models;}
The linked issue (mikeric/rivets#583) and linked issue there proposes some alternative ways to solve this problem. Still i don't really like those solutions :(
When adapter returns Collection.models, i loose access to attributes (builtin or custom) defined at my Collection.
So I did this,
// rivets cant iterate over Backbone.Collection -> return Arrayif(valueinstanceofCollection){value.models.parent=value;returnvalue.models;}
This way i can check for it. obj.parent instanceof Backbone.Collection
And access attrs using obj.parent.attr.
I know in order to iterate over backbone collection adapter returns internal array instead of collection. That really annoying for cases when you need collection, for example when you pass it as parameter to component (as attribute)
So, I suggest to move such decision to configuration option:
cc: @azproduction @der-On @generalov @StephanHoyer @Jmeyering @jeron-diovis
The text was updated successfully, but these errors were encountered: