How to add events when using an iron router and meteor?

Before using the iron router, I connected events using:

Template.templatename.events = {};

Using an iron router, you pass data through the data attribute in the route and usually do not touch the global Template object ... so where should I put the events? Should I continue to use Template.tempaltename.events?

Do you intend to use the global Template object with iron-router?

+4
source share
2 answers

: "" "". Template.name.events : , , .

, , , DOM node, -.

, Template.name.events, Template.name.rendered, .created, .deleted, .customDataHelper ..

 


 

, events:

Template.name.events({
   ...
});

.

+3

, . . , , Meteor UI, , , , , .

+1

Source: https://habr.com/ru/post/1502467/


All Articles