meteor-blaze

Access an object's property names in a Blaze template

霸气de小男生 提交于 2019-12-12 10:55:14
问题 Say I have a helper that looks like this: Template.profile.helpers({ info: { Name: 'Bob Dinkleberg', Age: 45, Location: 'Earth, Milky Way' } }); I want to put this info in a <ul> . Here is some pseudo-code: <template name="profile> <ul> {{#each}} <li> {{key}}: {{property}} </li> {{/each}} </ul> </template> Forgive me if this is trivial, I am new to Meteor and Blaze, and I haven't been able to find a solution online. 回答1: This will be helpful: http://meteorcapture.com/spacebars/ You want to

Meteor.js: how to swap partial templates in and out of the main page

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 10:04:12
问题 Just starting with meteor. Looking for a way to have a single "main page", which would contain an area, in which different partial templates could be swapped in and out, at a click of a Next/Previous buttons. I understand how to include partial templates statically by using {{> step_1_Template}} syntax. What I need, is to have the Next/Previous buttons permanently on the main page, and, when the Next button is clicked - remove the {{> step_1_Template}} and insert the {{> step_2_Template}}.

How can I make Meteor templates available to targeted audiences via an URL?

 ̄綄美尐妖づ 提交于 2019-12-12 05:42:06
问题 I want to build a Blog, of sorts, with Meteor but, rather than just have a Blog such as platypus.meteor.com, I want to create a separate Meteor template for each Blog "post" and then send a link to select people such as "platypus.meteor.com/thispost" In this way, the person would only see the post I intend them to see; to see others, they would have to guess at other values, such as "/thatpost", "/theotherpost" etc. And in my case, if they stumbled across them, no big deal. This is my plan:

Inconsistent updating of Meteor template

送分小仙女□ 提交于 2019-12-12 04:36:30
问题 Using Meteor with blaze templates and flow router, I find that if I create a new element then the page doesn't update to show it, but if I delete the same element it disappears immediately. Here's the template code: <template name="EditProject"> ... {{#each currentCounts }} <div class="count-box">{{> CountDelete }}</div> {{/each}} ... <btn class="btn waves-effect waves-light h-button" id="add-count">Add Count</btn> ... </template> <template name="CountDelete"> <div class="card blue-grey

Meteor creating a scrollable div

安稳与你 提交于 2019-12-12 03:55:35
问题 Hey guys new day new question ;) im trying to make a scrollable div should be no problem but it does not work ;( in the div i am outputting names of my database and when the space is too small you should scroll it but the scrollbar doesnt appear my html: <template name="friendsScroll"> <div class="CSSFreundeScrollListe"> <ul> {{#each friend}} <li>{{Name}}</li> {{/each}} </ul> </div> </template> my css .CSSFreundeScrollListe{ background: #00BFFF; height: 150px; overflow: scroll; (or auto both

Meteor: There is no route for the path error. how to access SINGLE article within a nested object

妖精的绣舞 提交于 2019-12-12 03:39:11
问题 I have an array of 10 objects 'categories' and each category has sub objects such as posts within that category. This is how it looks. I access the category list like this. <template name="CategoriesMain"> {{#each articles}} <li> <a href="/unfiltered/{{_id}}"><h2>{{name}}</h2></a> </li> {{/each}} </ul> </template> this link <a href="/unfiltered/{{_id}}"><h2>{{name}}</h2></a> accesses the 'posts' list within the category which looks like this <template name="CategoriesSingle"> <h1>This is a

How to add email template containing embed html code in meteor project

旧时模样 提交于 2019-12-12 03:28:14
问题 I am new to meteor js. Could you please suggest me how to add email template containing embed html code in meteor project. I had tried few packages,but its not working.Could you please explain with a sample example. Note: When a user register into my site. Both of us (new user and me) have to get the email. Both contains different embed html content. 回答1: Here is a basic example assuming you use blaze: In your template events: var email = emailAddress; //define emailAddress var dataContext =

Conditionally mark a checkbox as checked in Meteor using Blaze

末鹿安然 提交于 2019-12-12 03:17:53
问题 I'm not entirely sure what's wrong here, or how I'm supposed to approach it differently - but googling just brings up references to 'isChecked' - something I'm not using. I just want to flag a checkbox as checked if the associated field value is present: <input type="checkbox" name="services.bananaExports" {{ #if currentUser.profile.services.bananaExports }} checked {{ /if }} /> But I'm getting: Reactive HTML attributes must either have a constant name or consist of a single {{helper}}

Seperate publish function our of schema and into server/publications.js

早过忘川 提交于 2019-12-12 01:43:54
问题 I'm trying to update my application to utilise Meteors suggested file structure and I'm having trouble separating the publish function from the schema file. the file structure I'm trying to use is imports/ api/ profile/ server/ publications.js Profile.js When I combine the publish function into the Profile.js schema file the publish function works and the data flows through to the client however when I separate them I'm unable to get it to publish. Can someone please show me how to separate

call method in Iron-Router RouteController from Template.tmpl.helpers() not working

会有一股神秘感。 提交于 2019-12-11 20:01:54
问题 I'm trying to push new data on to my clients array each time the loadMoreClients method is called. The publication is expecting this back_to parameter and knows how to handle it. My problem is that I can't seem to call these methods from my Template helpers . I logged Iron and Iron.controller to the console and both of those exist and are showing me what I expected to see. I just can't seem to find current docs or examples of how to access Iron.controller() methods/properties from my Template