I am trying to find a practical way of handling events with famous-views in Meteor.
So I've read gadicohen's documentation (famous-views demo) and so far it works. But if I add a layoutTemplate to my iron:router and route to the templates with {{>yield}} then I can only catch the events from the layoutTemplate's JS-file.
Meaning I would have to include all my JS-logic into the layout-JS-file, which seems unpractical.
layout.html:
{{#famousContext id="MainCtx"}}
{{> yield}}
{{/famousContext}}
layout.js:
Template.layout.events({
'click': function() {} // works!!
});
someTemplate.html:
<template name="someTemplate">
{{#Scrollview align="[0,0.06]" origin="[0,0]"}}
{{#famousEach items}}
{{>Surface template="item" size="[undefined, true]" }}
{{/famousEach}}
{{/Scrollview}}
<template name="item">
<div id="{{_id}}" style="height: 100%; width: 100%;>
<template>
someTemplate.js:
Template.someTemplate.events({
'click': function() {} // doesn't work
});
I have also tried famousEvents, but without success. With target.on() I don't even know how to address a surface inside a Scrollview.
So what would be the Meteor way to do this?
Thx and regards