javascript - How to insert a template inside a meteoric IonPopup.show -
i'm trying have rating form inside meteoric ionpopup. have button show form:
template.thing.events({ 'click [data-action="showreview"]': function(event, template) { ionpopup.show({ title: 'leave review', cssclass : '', templateurl: 'reviewpopup.html', buttons: [{ text: 'cancel', type: 'button-default', ontap: function(e) { e.preventdefault(); } }, { text: 'ok', type: 'button-positive', ontap: function(e) { return scope.data.response; } }] }); } });
which ideally should put reviewpopup.html in body
reviewpopup.html
<template name="reviewpopup"> {{#if currentuser}} rating: {{> rating}} {{/if}} </template> <template name="rating"> <div class="rateit"></div> </template>
however can't seem templateurl option work. both templates in same directory. correct in thinking give file name , inserts content of file body? docs ionpopup.show say:
templateurl: '', // string (optional). url of html template place in popup body.
it looks referring ionic docs - meteoric follows ionic conventions, not closely can assume implementations same. best way use meteoric studying example meteoric apps , looking through code.
in case, the relevant code meteoric repo looks this:
// figure out if template or html string passed var innertemplate = ''; if (options.templatename) { innertemplate = template[options.templatename].renderfunction().value; } else if (options.template) { innertemplate = '<span>' + options.template + '</span>'; }
..so looks want use templatename:
, template's name, instead of ionic's templateurl
. hope helps!!
Comments
Post a Comment