I made a very simple app, built it for Android and then installed on my phone.
After launching the server with “meteor run”, I run the app and I see the data
just for one second and then it just disappears. Like the collection was dropped.
If I test it on the browser or on the Android emulator, the data is right there. The collection is fine.
The code is something like that:
<template name="news">
{{ #each items }}
<hr/>
{{ title }}
{{ /each }}
</template>
.js
Headlines = new Meteor.Collection('headlines');
if (Meteor.isClient) {
Meteor.subscribe('headlines');
Template.news.helpers({
items: function() {
return Headlines.find();
}
});
}
if (Meteor.isServer) {
Meteor.publish('headlines', function() {
r = Headlines.find();
return r;
});
}