简体   繁体   中英

How to perform a function onRendered inside events?

How to perform a function onRendered inside events ? The sample code below does not work. How is the correct syntax? If this is allowed, of course.

Template.myTemplate.events({
  "click": function(event, template) {
    this.instance().onRendered(function() {
      alert('hello');
    });
  }
});

Using Google Translate.

You can use Blaze.render .

If you just wanna get the data which bind to your item from your event handler, use

Blaze.getData(event.target)

Reference is here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM