spacebars Questions
3
Solved
I have this column in this database with a spacebar included, which I want to change.
ALTER TABLE . CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11);
After using this line in the command ...
6
Solved
I have following code:
<div class="form-group {{#if afFieldIsInvalid name='latitude' OR name='longitude'}}has-error{{/if}}">......</div>
How can I use AND/OR in if conditions of spa...
1
Solved
I am writing a custom Blaze block helper with children:
<template name="parent">
{{> Template.contentBlock ..}}
</template>
<template name="child">
{{> Template.contentB...
Thanatos asked 7/3, 2018 at 12:35
3
Solved
I am trying to do what I think should be a very simple task, but have been failing to do so in the past hour. I want to select a select option by default if the user property matches the value.
&l...
Alternation asked 9/7, 2014 at 10:0
5
Solved
I have all my image files served from a different domain, and I put that host name as a variable into Meteor.settings. Then, how can I access this variable within a Meteor template?
For example, i...
Gaberones asked 24/4, 2015 at 5:55
3
Solved
I've had in my Meteor project handlebar helper:
Handlebars.registerHelper('isEq', function(v1, v2, options){
if(v1 === v2){
return options.fn(this);
}else{
return options.inverse(this);
}
});...
Koslo asked 26/4, 2014 at 9:21
8
Solved
How can I reference a template helper from another one? For example...
Template.XXX.helpers({
reusableHelper: function() {
return this.field1 * 25 / 100; //or some other result
},
anotherHelpe...
Clinkerbuilt asked 29/1, 2015 at 10:6
2
Solved
I have this block of code in a Spacebars template:
1.
<select class="form-group">
{{#each choices}}
<option>{{this}}</option>
{{/each}}
</select>
I would like to repe...
Redstart asked 27/3, 2015 at 18:16
2
Solved
I want to be able to use Meteor template helpers to dynamically specify the content of a <meta> tag. It seems like there is no way to do this.
If I put the <meta> tag in a free-floatin...
6
Solved
So let's say I'm storing <div>{{name}}</div> and <div>{{age}}</div> in my database.
Then I want to take the first HTML string and render it in a template - {{> template1}...
Paratroops asked 1/5, 2014 at 19:36
3
Solved
I have a collection that has values like { "pctFail" : "0.3515500159795462" } and when I pass this to a template and display as {{myTemplate}}% it displays in my html as 0.3515500159795462%. How do...
1
Solved
I am willing to set the header of my app, based on Session variables.
Here is the Spacebars template :
{{#if session 'header'}}
<header id="page_header">
{{#if session 'header_left'}}
...
Kellykellyann asked 27/9, 2015 at 8:31
1
Solved
I have a 10x10 array representing 10 rows with 10 cells each.
I want to draw a grid and set each cell's background-color according to the value in the array:
a 0 value will be white and a 1 value ...
4
Solved
I'm having trouble with a callback after the #each has finished. I have a template named "content":
<template name="content">
{{#if Template.subscriptionsReady}}
{{#each currentData}}
<...
Pincus asked 8/9, 2015 at 15:25
6
Solved
Say I have an object, someObject:
{
foo: "apple",
myArray: ["abc", "def"]
}
And a template helper that looks like this (and works fine):
getArray: function(){
var self = this;
self.myArray ...
Soekarno asked 14/6, 2014 at 23:6
2
I've been following a tutorial to make a simple forum, after finally getting all the code get together, it tells me 'Template is not defined'
Code of forum.html
<head>
<title>Forum&l...
Sill asked 11/2, 2015 at 2:6
3
I'm iterating through a collection in Meteor using {{#each}} and I would like to know if I'm in the last element, as I can do in AngularJS while using ngRepeat with $last.
It could be used, for ex...
Outofdoor asked 11/11, 2014 at 10:9
1
Solved
I haven't been able to find a solid example out there.
Template.registerHelper("itemLookup", function(sku, property){
return Items.findOne({sku: sku})[property];
});
How do I call this on the t...
3
Solved
In many templates I want to use the same functions, but they must defined in every template.
like this:
function getNodesById(id){
return collection.find({sid:id}).fetch();
}
Template.navigation...
Carte asked 11/3, 2013 at 3:0
1
Solved
I want to access the first item of an array inside a meteor template, I'm using this syntax :
<p>{{array[0]}}</p>
However it doesn't seem like it's working. I don't want to iterate t...
Fumigator asked 3/3, 2015 at 22:58
1
Solved
I want to use an if condition in a Meteor Blaze template. Let's say you have a helper users on the Users collection you want to iterate through tasks and if the username is admin, use a "red" style...
Neogothic asked 23/2, 2015 at 9:25
1
Solved
I'm attempting to write a Meteor package which can be placed inside templates. So I first attempted to register a helper.
Template.registerHelper('testHelper', function(a, b) {
console.log(a);
c...
2
Solved
Is there a way to shorten
{{#if arg1}}
{{#if arg2}}
//stuff
{{/if}}
{{/if}}
to just a single if?
{{#if arg1 arg2}}
{{#if arg1 && arg2}}
Both of the above don't seem to work.
Worden asked 4/11, 2014 at 21:17
1
Solved
I have one general {{>yield}} for iron-router in a layout file which renders my pages, which are templates.
In one of my pages, I have a side menu and according to the selection in this menu, I w...
Mcgruter asked 27/8, 2014 at 11:54
1
Solved
Example:
I am writing a Meteor app that deals with a list of blog posts. All blog posts are stored in a collection called 'Posts'. I use Iron Router for routing.
I want to show the user a list of...
Cele asked 19/8, 2014 at 13:35
1 Next >
© 2022 - 2024 — McMap. All rights reserved.