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
How can i use hooks on a Collection2 insance? #50
Comments
Just create an AutoForm instance on the client, passing in the Collection2 as the only argument to the constructor. Then attach all your hooks to the AutoForm and use the AutoForm for your autoForm helper's schema attribute. On Thu, Dec 12, 2013 at 3:59 AM, kevohagan notifications@github.com
|
It's strange because in your example you dont pass the Collection2 Documents in an instance of AutoForm to get your hooks. I define a collection2 Workshops That is what im doing on the client :
with
and i get Exception from Deps recompute: TypeError: Cannot call method 'simpleSchema' of undefined im definitely missing something simple |
If i define it like
with
i get Exception from Deps afterFlush function: TypeError: Object [object Object] has no method 'hooks' but if i call it with Workshops.callbacks it works! but console returns
weird |
Maybe a bug. I won't be around a computer for a couple days, but I'll test as soon as I can. On Fri, Dec 13, 2013 at 11:44 AM, kevohagan notifications@github.com
|
@kevohagan i was stumped by the same issue for a little while. your original example was 99% there, you just forgot quotes around |
Did you resolve this? Let me clarify a few things:
In the specific issue above, as @chrisbutler mentioned, you can either add quotes around Template.myTemplateName.WorkshopsForm = function () {
return WorkshopsForm;
}; |
Yes Perfect resolved it! Much clearer now ;) . For the record that is what i did :
works like a charm! :) |
Or from a collection2 how can i define a autoform instance to use it's hooks system?
i looked at the autoform example but i dont get how it defines the documents.hooks since its a collectin2 instance and shouldnt be able to use the callbacks/hooks.
Thanks a lot 👍
The text was updated successfully, but these errors were encountered: