I'm pretty new to Meteor and need some help.
I have an outer parent template that contains a side slide menu. That side slide menu is using the new Blaze Dynamic Template include.
<div id="parentTemplate">
{{>yield}}
<div class="right-slide-menu">
{{> UI.dynamic template=rightSideMenu}}
</div>
</div>
So since I'm using Iron-router, when a new child template gets injected into "yield" from iron-router the right side menu needs to change depending on what "page" it is on now. I am trying to figure out how to update the parent Dynamic template slide menu from the child template. I can do this pretty easily with Angular...but I can't seem to figure this one out using Meteor.
Any help would be really appreciated!
Okay, I actually got this to work. I found the solution on this blog here:
http://empire5.com/development/meteor-rendering-a-handlebars-template-with-dynamically-loaded-data/
UI.render and UI.insert are deprecated (although it still works for now) so I adapted his instructions to the new way of doing this:
after upgrading to meteor 0.9.1 i keep getting "Warning: Blaze.insert has been deprecated."
So the final code looks like this:
<div id="parentTemplate">
{{>yield}}
<div class="right-slide-menu">
<div class="sideMenu">
<!-- side menu template gets injected here -->
</div>
</div>
</div>
Inside my child template manager I have this:
Template.dashboard.events({
'click #showSideMenuBtn' : function(e){
e.preventDefault();
// pass in the name of the template you want to inject and
// also the parent container you want to inject it into
Blaze.render(Template.addManagerForm, $('.sideMenu')[0]);
};
});
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments