Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/themeteorites/blaze-magic-events

A new way of binding event handlers to html elements for Meteor's Blaze.
https://github.com/themeteorites/blaze-magic-events

blaze event-handlers meteor meteor-blaze

Last synced: 3 months ago
JSON representation

A new way of binding event handlers to html elements for Meteor's Blaze.

Awesome Lists containing this project

README

        

# blaze-magic-events
A new way of binding event handlers to html elements for Meteor's Blaze.

note: all code is ES6

Template

```html

Say Hi!
reset
say "hi" (using args)

```

Event handlers

```js
Template.helloworld.events({
sayHi (e, t) {
console.log('event and templateInstance params', e, t)
t.$('p').html('hi there from sayHi() handler!')
},
reset (e, t) {
t.$('p').html('')
},
say (e, t, who, what) {
t.$('p').html(`${who} says ${what}`)
},
})

Template.helloworld.helpers({
name () {
return 'template'
}
})
```

Enjoy! Feedback welcome. Example app given.