Questions tagged [handlebars.js]

Handlebars is a templating library for JavaScript.

1
vote
1answer
17 views

Switch case with default

I want to implement custom switch case with default value in HandlebarsJs. Example: HTML: <div> {{#switch 'a'}} {{#case 'a'}} A {{/case}} {{#case 'b'}} B {{/case}} ...
0
votes
0answers
14 views

How to resolve “Established libraries must be included separately” comment on Firefox Add On review?

One of my Firefox add on failed review and I got the following comment: Established libraries must be included separately, from their official source, in their original format without any ...
0
votes
1answer
11 views

“handlebars.registerHelper is not a function”

I want to create a simple reverse handlebars helper, but on app.js running, I have this error: TypeError: exphbs.registerHelper is not a function at Object.<anonymous> (C:\wamp64\www\test\login\...
1
vote
1answer
22 views

age verification pop up on not getting existing cookie

I have a age verification pop up when a user visits the site for the first time. I want to box to pop up when going to the site for the first time and not ask again unless closing out the browser and ...
1
vote
2answers
27 views

Why is app.engine not defaulting to layout.hbs as a default

I created a style format with the layout.hbs and notice that all of the pages are not sharing the same consistency in style. I have noticed that I did not declare an app. engine within the app.js. ...
0
votes
0answers
10 views

'Failed to lookup view “main” in views directory' error with Handlebars

I want to code a simple Handlebars js file, but it's not working, on page loading, I have this error: Error: Failed to lookup view "main" in views directory "...\handlebars\views" I have no idea ...
0
votes
1answer
24 views

Getting Specific Number of Days With Moment.js, Node npm and Handlbars

I am using moment.js in node Handlebars. I found this helper: http://moment.handlebars.solidgoldpig.com/ and it's been useful but I would like to be able to calculate the number of days between now ...
0
votes
1answer
14 views

Generate Express Routes Dynamically from MongoDB Data which changes every few Minutes

I want to create a web page that dynamically renders data from mongoDB. I am crawling articles on the internet and then saving data related to that in a MongoDB. Now I want to create dynamic routes ...
0
votes
1answer
20 views

Ember: Send child component's action to a parent component

I am trying to call/trigger a child component's action from a parent. I've tried this a couple ways but I'm not getting anywhere. This is basically what I have so far. I am attempting to send the ...
0
votes
0answers
24 views

Helper function to sum from Node and Handlebars

I have data in mongo that Node pushes to a Handlebars template. I need to perform calculations on the data, and I have written a javascript function that performs the calculation I want for each ...
-1
votes
0answers
82 views

How to make text in <p> tag overflow?

I just encountered a problem that I don't know how to deal with. "<div class='row col-sm-5'>" + "<div class='col-4' style='margin: 0; padding: 0'></div>" + "<div class='col-4' ...
0
votes
1answer
22 views

handlebars - add content to head of view from partial

I am using express-handlebars in my project and have the following problem: Question I want to be able to add <script> oder such tags to my overall views head from a partial that is called ...
0
votes
1answer
26 views

Webpack 4 - copy dubdirectory structure

At this moment I have this Webpack 4 & Handlebars structure src/ ├── assets/ │ ├── css/ │ ├── fonts/ │ ├── img/ │ ├── js/ │ ├── scss/ │ └── vendor/ ├── helpers/ │ ├── repeat.js │ └...
0
votes
0answers
15 views

Modal from Handlebars only displays 0 Index for all entries

I have a dynamic list I am printing to the user of articles scraped using Cheerio. They display via handlebars with a modal created inside each article iteration. My only catch is the modal is meant ...
0
votes
0answers
11 views

Display partial handlebars based on Mongoose json docs value

I would like to ask if I could pass a JSON value into a partial view in handlebars. So, the concept is getting the required data by id, then parse it into a partial view for display. Here is the ...
0
votes
0answers
11 views

Can you shorten htmlWebpackPlugin.options?

I am using Html Webpack Plugin to access a json file in Handlebars.js. Is there any way to create a variable to shorten htmlWebpackPlugin.options so I don't have to type something really long like ...
0
votes
0answers
13 views

Handlebars no such file or directory

Im trying to load a handlebars file called login.hbs but I keep getting an error: Error: ENOENT: no such file or directory, open '/Users/admin/Documents/tc-master/server/views/layout/default-layout....
0
votes
0answers
8 views

How do I use handlebars-layouts with express-handlebars

This is my current Express setup. How do I integrate handlebars-layout with this setup (https://www.npmjs.com/package/handlebars-layouts). I want to still use express-handlebars defaultLayout thing. ...
0
votes
0answers
20 views

How to return array of query results (Node.js & MongoDB)

I'm trying to create an array of query results so that I can use that array to populate one of my handlebars pages. Each index in the array holds Comments with a unique attribute. I currently have it ...
0
votes
0answers
6 views

context evolution between nested helper block

helper: Handlebars.registerHelper('eq', function (a, b, opts) { if (a == b) { return opts.fn(this); } else { return opts.inverse(this); } }); the data : var context =...
0
votes
2answers
22 views

How to select json item un handlebar

How can I select an element in a json array in Handlebarjs I tried navigating the each but the position of the element in the array. Json array
0
votes
1answer
26 views

Ember handlebars How can I make an Ajax or jquery call for an handlebar file?

<div class="ui form segment"> <div class="field"> <div class="ui selection dropdown" tabindex="0"> <div class="default text"> Select </...
1
vote
0answers
34 views

CSS seems to be sent to page, but nothing applies [ExpressJS + Handlebars]

I am attempting to do a very simple page with Handlebars and Express with NodeJS, however I am running into difficulty getting it to display css. It seems that the browser is receiving the CSS file ...
0
votes
0answers
15 views

How can you render an image returned from a DB query using handlebars and nodejs?

I've managed to get some test images (jpg) inserted into my DB2 DB using ibm_db2, it actually appears to have worked by the book. The challenge I'm having now is that when I retrieve one it kills ...
0
votes
2answers
18 views

Handlebars access nested array values by index in placeholders

I just begin with handlebars.js to render following json, but I am not sure how to access the values of nested json array using index. Following is the template, I tried with {{this.1}} and {{1}}, ...
0
votes
1answer
12 views

Compiling handlebars template using gulp but ignoring variables

I am using Handlebars as a templating language for creating email and print communication templates. The templates share common elements and so I'm moved them into partials. The issue I'm facing is ...
0
votes
0answers
17 views

displaying correct date in console but in html page it is getting changed( nodejs and hbs) [duplicate]

var check_in=doc.check_in; var check_out=doc.check_out; console.log(check_in,check_out); This is the output in the console: 2018-10-31T00:00:00.000Z 2018-11-02T00:00:00.000Z When I am ...
0
votes
3answers
36 views

Ember does not update value of <input text> based on another property

Hi i have a simple code that updates a component's property value e.g. with a button click, and based on that value i need to update the value of the input text, like so: template: {{input value=...
1
vote
2answers
20 views

Get the value of an Object in Handlebars with a key

I have an array of objects (vehicles) and i would like to get the value of the objet by giving a key in handlebars. This is the array: "vehicles": [ { "value": "Car", "key": "...
2
votes
1answer
21 views

How to enable a component's property when i transitionToRoute

Hello i have a search component on page header. When i click on a magnifyng glass, a flag property is getting true, so the search-box component is displayed like so: When i press Enter on the ...
1
vote
1answer
35 views

How to exclude a specific div on 'focus-out' event

I work on an Ember application, where i have : 1. {{input type="text" focus-out="inputFocusOut"}} 2. <div class="mylist"><u><li action {{action "selectItem" item}}>item</li><...
0
votes
1answer
13 views

Show the compilation errors for handlebars.js in the log console

I am trying to know if Handlebars.js has some settings to make compilation errors appear in the console. In a retro-engineering project, it becomes very difficult to understand which parts are wrong.
0
votes
0answers
17 views

HandleBars NodeJS Populate webpage table

My MySQL database has 4 tables. Two with products, one with suppliers and one with prices of the products. Example: ID |Product_A --------------- 1 |Paper 2 |Pen 3 |Pencil ID |Product_B -----...
1
vote
1answer
33 views

How to show data in a hbs template?

Need some help with this, I'm trying to show data in the template but it doesn't works. I'm using NestJS with mysql. Here the code of the controller.ts: import { Controller, Get, Post, Put, Delete, ...
0
votes
1answer
23 views

How can I refresh the data in a handlebars view?

I am working on a project, part of which displays notifications to the user. I have an object which is used to store notifications, and a table in which notifications are displayed. The notifications ...
-1
votes
1answer
35 views

using handlebars , js node and express “ error: Failed to lookup view ”error“ ”

i am using handlebars with js rendering through express I am having issues solving the error. every time I run the localserver/300 I get an Error: Failed to lookup view "error" in views directory . ...
0
votes
0answers
10 views

Creating a filter of tags for a blog in handlebars/endurojs

I'm creating a blog with tags, each blog entry can have multiple tags that can be filtered to show blog entries with the same tag choosen. My problem lies when i'm filtering the results i'm not sure ...
0
votes
1answer
21 views

Callback Handlebars

Good morning guys, all right? I render a grid with handlebars, after that, I need to adjust the height of the cards and activate another jquery plugin referring to a select options that is rendered ...
0
votes
0answers
11 views

Override compodoc template

Hello I am using compodoc 1.1.5 to generate the documentation for my angular project. Compodoc provides the ability to override the template by using the option --template folder_name. I tried to ...
0
votes
1answer
31 views

Metalsmith-collection not finding markdown files

I have a static website using handlebars and metalsmith. I can create a collection called carriers from my metalsmith config file but the plugin pattern ignores the markdown files so carriers is ...
0
votes
1answer
41 views

Ghost Blog: Dynamic Routing with static home page not working as expected

I have just set up a Ghost Blog. This is a clean install on a VPS, and it is up and running correctly. By default, Ghost shows a list of posts when opened in the browser. I would like to have a home ...
0
votes
1answer
17 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" }, { ...
0
votes
0answers
18 views

save or download a json file in client pc

I am trying to save a JSON file into client pc via the browser. I am following below steps. would you mind advising me what is wrong? I am using Node.js express-handlebars. The user press this url in ...
0
votes
0answers
8 views

Include styles and scripts inside partial views express handlebars

I have a front-end project running on node-express with handlebars as the view engine. I have a layout file called loginlayout which just runs a html skeleton and inside the body : {{{ body }}}. Now ...
0
votes
1answer
15 views

Iterating through the array values using handlebars #each loop

I have two arrays named firstnames and lastnames. The values these two arrays hold are as follows:- firstnames =[ 'A', 'B', 'C','D','E' ] lastnames =['a','b','c','d','e'] I am rendering these two ...
0
votes
1answer
28 views

How to write a script in Node.JS-Express with Handlebars template

I am new to Node.Js. I created an application with Node.JS Express. now I have below folder structure -core app.js -routes index.js -views index.hbs I want to store a json file into ...
1
vote
1answer
31 views

Passing a Handlebars component output as a parameter to a helper

I'd like to use the output of a component as a parameter to my helper, but am not having much success. My Ember template is something like this: <td class="wrap"> {{generate-url 'http://...
1
vote
0answers
24 views

How to filter a web page by form submission or link click and refresh the page?

My template: <h3> artworks </h3> <form action="/" method="get"> <label for="filter">Filter by a tag: </label> <input id="tag" type="text" name="name_field"&...
0
votes
1answer
21 views

Trouble working with helper on handlebars + express

I'm trying to use helpers, but I get this error: ReferenceError: a is not defined I'm trying to display home.hbs under the views dir. because it contains things like: <li class="{{#if_eq title "...
0
votes
0answers
46 views

Sending objects to handlebars template page

New with express and handlebars. I am attempting to send a javascript object and display the values on the page. Sending the object based on a mysql query: con.query("SELECT * FROM users", function (...