kmalakoff/knockback

How to set kb.ViewModel override to use override of kb.CollectionObservable

Closed this issue · 2 comments

Hey Kevin,

First off, knockback rocks!

Second, having a little issue that I'm sure is just due to me not knowing how to get around...

Let's say i have my own view BoxView that extends from kb.ViewModel

One of the properties of the model I pass into BoxView is itself a Backbone.Collection. However, I need to use my BoxRulesCollectionObservable, which inherits from kb.CollectionObservable.

kb.ViewModel automagically sets anything that is instanceof Backbone.Collection to kb.CollectionObservable --- how can I override this?

Thanks!

So, those interested parties I figured out my own question. This is precisely what the "factories" attribute is for. See the example here:

http://kmalakoff.github.io/knockback/getting_started_knockback_important_details.html

I'm glad you are enjoying it. And that you found your answer in the docs!

Happy coding....