javascript - jQuery modal execution meteor -
I have a jQuery model, I am trying to execute the meteorite code like this:
& lt; Template name = "group list" & gt; & Lt; Div class = "noGroups" & gt; & Lt; Div class = "jambotron" & gt; ... & lt; Button class = "BTN BTN-Primary BTN-LG Modal-Toggle" & gt; Create a group & lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt; {{& Gt; CreateGroup}} & lt; / Template & gt;
& lt; Template name = "createGroup" & gt; & Lt; Div class = "modal fade" id = "createGroupModal" tabindex = "- 1" role = "dialog" aria-labelbedby = "myModalLabel" aria-hidden = "true" & gt; ... & lt; Input type = "submit" value = "create!" Class = "BTN BTN-Primary Model-Toggle" /> ... & lt; / Div & gt; & Lt; / Template & gt;
When I add jQuery to the top-level code, it works fine, like:
However I want to transfer it to a .js file. The JS file I am using is located in the same directory. I am loading HTML. I think I need to use Template.events here, so I tried to do this, but the bind was not the same. It seems, because when I click on the button, nothing happens:
Template.groupsList.events ({'click .modal-toggle': function () {$ ('# createGroupModal ') Model (' Toggle ');}});
What am I missing? What is the proper meteorite route to do this?
One problem in one of my template names, can not believe how many cycles Burned.
Comments
Post a Comment