Hey guys,
I’m running into a weird problem with my template subscriptions. This is my code:
Template.editAppointment.onCreated(function() {
var self = this;
self.autorun(function() {
self.subscribe("appointment", Router.current().params._id);
});
});
Pretty straightforward, I guess. The problem is that I’m getting this console error whenever I reach this template:
Uncaught Error: Can't call View#subscribe from inside the destroyed callback, try calling it inside created or rendered.
As you can see, it is inside a created event. For the records, I’m using Iron Router.
What could I be missing here?