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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -