Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/themeteorites/blaze-magic-events
- Owner: themeteorites
- Created: 2015-06-09T00:08:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-19T10:20:08.000Z (about 8 years ago)
- Last Synced: 2024-02-12T05:38:30.799Z (9 months ago)
- Topics: blaze, event-handlers, meteor, meteor-blaze
- Language: JavaScript
- Size: 12.7 KB
- Stars: 26
- Watchers: 1
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-blaze - themeteorites:blaze-magic-events - A new way of binding event handlers to html elements for Meteor's Blaze. (Uncategorized / Uncategorized)
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.