Questions tagged [spacebars]
Spacebars is a Meteor template language inspired by Handlebars. It shares some of the spirit and syntax of Handlebars, but it has been tailored to produce reactive Meteor templates when compiled.
434
questions
0
votes
0
answers
18
views
Space key resets the game
i wanted to make a game and followed a tutorial to make a Tetris game, while playing it i noticed that when you press the space button the whole game resets, i cant figure out how to fix that. My ...
0
votes
0
answers
28
views
Data Context Object in Meteor-Blaze
I'm failing to understand what is a Data Context Object in Meteor-Blaze. Can someone explain what is a Data Context Object in Meteor-Blaze? I've searched in the internet yet I couldn't find any proper ...
0
votes
1
answer
92
views
Exception from Tracker recompute function: ReferenceError: $el is not defined
i am following the following error when trying to filter the images posted by a certain user
the error :
Exception from Tracker recompute function:
meteor.js?hash=...
0
votes
1
answer
93
views
Pug.js accessing json keys with spacebar or whitespaces in for each loop
I have a problem accessing json keys with whitespaces or spacebars inside in pug for each loops. Backticks, single and double quotes didn't work for me so I had to fall back to this.
.pug file
for ...
0
votes
1
answer
34
views
Spacebars for HTML ‘disabled’ HTML input
I'm disabling textareas using the disabled HTML property.
<textarea disabled>{{foo}}</textarea>
Simple enough. That enables it so that the client cannot enter the textarea and make ...
0
votes
1
answer
70
views
Meteor embedded documents reactivity
I have a bootstrap modal that will display info about a parent document. The modal then has next/prev buttons that can rotate around a list of parent documents and reactively change the info displayed ...
2
votes
2
answers
566
views
Remove event listeners when user press 'space bar'
I need to remove all event listeners when the user presses the space bar and get them back when press again the press bar or any key. How can I achieve it?
My event listeners:
function makeRows(rows, ...
1
vote
1
answer
2k
views
simple toggle with spacebar in processing
I'm trying to make it so when I press the spacebar, the box turns black. then, when I click it again it turns back to white. and so on. At the moment the box just flickers when I press space bar and ...
0
votes
1
answer
37
views
Verify if Spacebars HTML syntax is correct
I have a project using a Meteor + Blaze + Spacebars stack.
Whenever I have an error inside one of the HTML files (which are processed with Spacebars), the html is not loaded on the client. This is ...
1
vote
1
answer
41
views
How to detect sapce key in Android device virtual Keypad through Web App (ReactJS)
I am building a web app in ReactJS, where i want to call an API just after user hit space bar.
i have tried several Events like (onKeyPress, onKeyUp, onKeyDown) but got same keycode for every key ...
4
votes
3
answers
231
views
Misunderstanding `each...in` rendering with reactive variable
I'm new to Meteor/Blaze but that is what my company is using.
I'm struggling to understand how Blaze decides to render what based on ReactiveDict
TL;DR
I create some children templates from a ...
0
votes
0
answers
26
views
Event handler blocks rendering until completion
I made a Meteor/PhoneGap with Spacebars Android app and I want to show updates on the screen while it's doing work, but none of the UI changes I call in the event handler are actually shown. Here's ...
0
votes
1
answer
43
views
This.data from #each-iteration
I'm trying to access a value inside an {{#each in}}-iteration:
{{#each room in channels}}
<form class="enterRoom">
<button type="submit" class="roomJoin">
<b>{{room....
0
votes
1
answer
66
views
unable to use handlebars @first data propriety in meteor
I am rendering my past handlebars projects into a meteor app but it seems that there are @data properties that it doesn't support. Like @first which I used to create a reactive slideshow.
var ...
0
votes
1
answer
220
views
Is there a way to accordion within a nested each loop based on the outer each loop?
I have asked the question before to no avail however I have tried to implement a new strategy. I have a mongodb collection pieces that I'm pulling information from. Within the collection I also have ...
0
votes
1
answer
78
views
Accordion Bootstrap table with spacebars
I have seen questions pertaining to accordion but not entirely to my specific need. My table is populated using spacebars, more specific a nested each loop like this:
<tbody>
{{#each piece in ...
0
votes
2
answers
66
views
how to display objects in an array with spacebars
This may be a duplicate question but I've yet to find a solution to my specific problem. I have a db set up like this:
{ "_id" : ObjectId("5c43b0e463ad7e8adfa4f07a"), "name" : "The Box", "price" : "...
0
votes
1
answer
321
views
convert dynamic table into array
I have a table that updates dynamic (thank you to those who helped with my last publish/subscription inquiry) and I would like to store the data of each updated row into an array which I will then ...
0
votes
1
answer
59
views
#each helper to populate a table
I'm fairly new to meteor and I'm trying to iterate over a cursor using #each to populate a table. Here's my code:
<template name="choral">
<div class="container" style="padding-top: 25px">...
0
votes
0
answers
23
views
Detecting faulty handlebar/spacebar tags in texteditor : MeteorJS
I want the user to be able to write handlebar tags in a text editor like {{username}} which will be saved in the database to be rendered later in the server using server-side rendering.
However, I ...
0
votes
0
answers
274
views
JS: Make Audio Stop Through Spacebar
I'm trying to figure out how to stop/resume playing a track through the spacebar.
I've got all my keys working, just need to figure out how to make it stop whenever the spacebar is pressed.
<div ...
1
vote
1
answer
121
views
How to access final element in Handlebars.js array?
Given the following data structure:
{
"name" : "test",
"assetType" : "Home",
"value" : [
{
"value" : "999",
"date" : "10/03/2018"
},
{
...
1
vote
0
answers
233
views
How to call function after page load completed in meteor?
I am trying to call a function after the response has been sent to the browser, but my template load after the response sent to browser.
Template.orders.rendered = function() {
Meteor.setTimeout(...
1
vote
1
answer
48
views
Meteor optional template
So I have started to learn Meteor and trying to get my head around how I should format the template correctly. This is how I set up my project:
A/view.html - html file for template A
A/script.js - ...
0
votes
1
answer
48
views
How to display items in an array, within another array, onto HTML on meteor?
This is my js code:
Template.listModules.helpers({
'item' : function() {
var currentUser = Meteor.userId();
var stuff = Events.find(
{
createdBy: currentUser,
...
0
votes
1
answer
345
views
How can I auto-indent double bracket notation using Atom, in my HTML files?
In my Atom editor, I have a simple shortcut on the keymap:
'atom-text-editor':
'alt-a': 'editor:auto-indent'
In my *.html files, it does not indent Blaze liquid-like tags, for example:
{{#if ...
0
votes
1
answer
53
views
Are helper functions in Meteor reactive?
Suppose I have the following code in my HTML file:
{{#if someVar}}
{{>someTemplate}}
{{/if}}
Now, if initially someVar returns false then the someTemplate Template is not created. Now, due to ...
7
votes
1
answer
735
views
Meteor Blaze access Template.contentBlock inside Template.onCreated
I am writing a custom Blaze block helper with children:
<template name="parent">
{{> Template.contentBlock ..}}
</template>
<template name="child">
{{> Template....
1
vote
1
answer
47
views
Where does template.data of Blaze form go after first submit?
I use {{> ArticleForm}} for create and update Articles in arabic-russian dictionary. I use blaze and ReactiveDict in my templates, after some problems with Autoform plugin.
First I was using it for ...
0
votes
1
answer
874
views
Key Press Connect at Start of Execution
I have a Python 3.6.3 script that incorporates PyQt5. The GUI has a button that toggles play and pause of a video file. Pressing the spacebar also toggles play and pause. The button works fine all ...
2
votes
1
answer
353
views
Meteor blaze template access object property by key without helper
I wonder if it is possible to achieve object access by property-string like
const obj = { foo:"bar" }
obj["foo"] // returns "bar"
via Blaze Spacebars (thus, without using a helper function).
I ...
1
vote
1
answer
66
views
Pass arguments to helpers in Spacebars Template Inclusion
Say I have a template with a template inclusion
<template name="Profile_Page">
{{> Text_Form_Control value=helper_function}}
</template>
I want to return an array from my helper ...
0
votes
0
answers
129
views
Passing objects to html from Blaze Template helpers
I am looking for a way to be able to pass an object from Template.templateName.helpers to the html.
It seems that the syntax: {{objname.property}} does not work in spacebars.
How do I do it ?
1
vote
0
answers
70
views
How do you parse a string using Blaze Spacebars
Most of the documentation for Blaze Template engine focuses on using DOM nodes. I would like to process a string using Spacebars and get the finished string back.
My goal is something simple like ...
0
votes
0
answers
125
views
Meteor - Read HTML file contents and store in a variable
I am a newbie to Meteor. In my earlier project (Front end: Plain JS), i used 'underscore' js library as templating engine. I would like to acheive the same in meteor. But i face problems in getting ...
1
vote
0
answers
63
views
Meteor/Blaze/Mongo/ Spacebars Templating
Can one create an HTML table from documents within a Mongo collection, using {{#each}} braces AND pass a unique {{> template}} also from the Mongo document?
I've generated a table using {{#each}} ...
1
vote
1
answer
217
views
How can I put global template helpers together in Meteor?
I have several global template helpers
Template.registerHelper("termSuffix",function(){});
Template.registerHelper("subjects",function(){});
Template.registerHelper("date",function(){});
...
I ...
1
vote
1
answer
30
views
accessing _id from template event listener in spacebars #each loop
So I know that if I have the following html:
<template name="myTemplate">
<ul>
{{#each events}}
<li>
<h4 class="divEvent">{{title}}</h4>
</...
0
votes
1
answer
385
views
meteor dynamic template data context
This is a very simple repo, feel free to clone it to test a solution or comment on the commit if its an easy change I'm missing. https://github.com/Falieson/meteor-blaze-examples/commit/...
-1
votes
1
answer
25
views
Meteor iterating through data & helpers
I'm trying to iterate through the data but I want different layouts for different members in the team, like the President of the organisation should have col-md-12 (bootstrap - the entire width of the ...
0
votes
1
answer
294
views
Blaze template helper only returning on in a Spacebars each loop in Meteor/Mongo
I have a helper which should find all events that correspond to a given month and year argument and return them as an array for the template to loop through. It appears my helper is only returning for ...
0
votes
1
answer
259
views
pass current value of spacebars:this as argument to new helper in meteor/blaze
I am finding unique instances of years in a Mongo collection and passing them to my template as list items. Underneath these i want sub lists with the unique occurrences of months in that given year, ...
1
vote
2
answers
162
views
rendering alternate components under the same flow:router URL
How can I render two different views in a one page app without changing URLs. I'm using meteor with the default blaze as well as the flow:router package. Right now I have it set up like this:
routes....
1
vote
1
answer
279
views
meteor:How do I iterate over an array of objects when property name is not known
I have an array of objects over which I have to iterate, but I don't know the property name of object.
{{# each }}
{{??}}
{{/each}}
0
votes
1
answer
13
views
Meteor: Render a template into an area on a form after an option is selected
I am tryin to have a template rendered into an area on my form after a selection is made from the dropdown. My poor attempt is below, but it is just appending a string of the template.
example.html
&...
0
votes
2
answers
172
views
Meteor spacebars nested {{each}} helper issue
I have 2 collections: TestPlans and Users
TestPlans has an array called "assigned" which contains user _ids.
Users has an avatarUrl string
I need to iterate over each testPlan and furthermore each ...
1
vote
1
answer
613
views
inject div element between handlebars each
I want to place a div after fourth element of #each
<script type="text/template" id="template">
{{#each names}}
{{name}}
{{/each}}
</script>
If there are no 4 elements then in last. ...
0
votes
2
answers
49
views
Template reference error in meteor even if Template is already defined
I am getting this error even if I already defined template in my html, I am missing something.
Error in my console
index.html
<template name="navbar">
<nav class="navbar navbar-default ...
0
votes
2
answers
290
views
Passing variable into a modal through spacebars
Is there a way without going to JavaScript that Spacebars can pass a variable to a modal?
For example, when I try:
<button type="button" id="genbtn" data-toggle="modal" data-target="#entryModal"&...
0
votes
1
answer
435
views
Destroy/remove a meteor template in iron-router
I've just started using iron router in meteor. How do I hide or delete a template, or replace it with another?
I have two client-side routes. One shows a list of chatrooms a user can join:
Router....