| 123456789101112131415161718192021222324 |
- import { Template } from 'meteor/templating';
- import { ReactiveVar } from 'meteor/reactive-var';
- import '../imports/startup/accounts-config.js';
- import '../imports/ui/body.js';
- import './main.html';
-
- Template.hello.onCreated(function helloOnCreated() {
- // counter starts at 0
- this.counter = new ReactiveVar(0);
- });
-
- Template.hello.helpers({
- counter() {
- return Template.instance().counter.get();
- },
- });
-
- Template.hello.events({
- 'click button'(event, instance) {
- // increment the counter when button is clicked
- instance.counter.set(instance.counter.get() + 1);
- },
- });
|