{{#if isCordova}}?

Hi,

{{#if isCordova}}
  This is Cordova
{{else}}
  This is not Cordova
{{/if}}

does not identify when the user is on device. Is there another handler?

Thanks

Mike

You can easily write your own global helper.

Afaik there’s something like Meteor.isCordova. So just wrap that in a global helper and you got it.

Yes true, I should have thought about it.

Here is the helper for other newbies:

isCordova:  function() {

if (Meteor.isCordova) {

return true;

}

else {

return false;

}
}

Thanks!

You’d be better off doing this with Template.registerHelper to have a global helper that’s accessible in every template. Also, you probably don’t need if/else, Meteor.isCordova should return either true or false by itself.

Template.registerHelper('isCordova', function () {
	return Meteor.isCordova;
});

ok cool, even better. Thanks