Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavious do not get attached to Collections automatically #20

Open
svub opened this issue Dec 18, 2014 · 1 comment
Open

Behavious do not get attached to Collections automatically #20

svub opened this issue Dec 18, 2014 · 1 comment

Comments

@svub
Copy link
Contributor

svub commented Dec 18, 2014

I'm very happy that you continue the collection behavours package. I used it via mrt before and switched to Meteor 1 now.
I noticed one "strange" behaviour, or is it intended?

I wrote a behaviour called "owned" and want to attach it to a collection called "Activities". Here some testing code I wrote (using CoffeeScript):

log CollectionBehaviours
log Activities.owned?
CollectionBehaviours.extendCollectionInstance Activities
log Activities.owned?
Activities.owned()

(FYI, log is just a logger to console; ...? is CoffeeScript's way of checking for a var's existance, i.e. owned? equals typeof owned !== "undefined" && owned !== null in JS)

The output is:

Object {defineBehaviour: function, extendCollectionInstance: function} 
false
true

I.e. I need to call CollectionBehaviours.extendCollectionInstance Activities explicitly so that I can call owned() on the collection. Intentionally? (the mrt version did that automatically somehow)

@taromero
Copy link

taromero commented Feb 2, 2015

Thanks for pointing that out, I didn't know why it wasn't working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants