Last active
October 27, 2015 15:27
-
-
Save radiegtya/dba35350f03d8a4801a3 to your computer and use it in GitHub Desktop.
Meteoris Quickstart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ctrl = new Radiegtya.SiteController(); | |
/** | |
In the template helper section we are using index() method to get object return value from controller. It's because index was the action and also the file name suffix. This structure will make You easier to get jobs done, when your team getting bigger and the code getting bigger. | |
*/ | |
Template.radiegtya_siteIndex.helpers({ | |
myName: function () { | |
return ctrl.index().myName; | |
}, | |
myHobby: function () { | |
return ctrl.index().myHobby; | |
}, | |
counter: function () { | |
return ctrl.index().counter; | |
} | |
}); | |
/** | |
in the template events, we don't need to use index() method to call any action. Because it just simply method calling through controller. | |
*/ | |
Template.radiegtya_siteIndex.events({ | |
'click button': function () { | |
//increment the counter when button is clicked | |
ctrl.setCounter(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment