// templates.html
<template name="home">
<p>foo bar</p>
{{> myModal}}
</template>
<template name="myModal">
<div id="mymodal" class="ui modal">
<p>My modal</p>
<button id="mybutton">Click here</button>
</div>
</template>
// templates.js
Template.myModal.rendered = function () {
$('#mymodal').modal('show');
};
Template.myModal.events({
'click #mybutton': function () {
console.log('clicked!');
}
});
The modal appears, but the events don't work. I think the reason is because the DOM element is moved from its original position.