-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
33 lines (29 loc) · 796 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
if (Meteor.isClient) {
Template.hello.helpers(
{
greeting: function () {
console.log("retunring greeting text")
return "Welcome to app.";
},
name: function() {
return Session.get("name");
}
})
Template.hello.events(
{
'change #name': function () {
console.log("changing the name");
Session.set("name", $("#name").val());
},
'click input': function () {
// template data, if any, is available in 'this'
if (typeof console !== 'undefined')
console.log("You pressed the button");
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}