Newest 'dust-helpers' Questions

Q&A for professional and enthusiast programmers

Dust.js Template Custom Helper in Bootstrap Inconsistent Behaviour

I have a Dust.js helper where I apply some acl logic as follows: 'use strict'; import dust from 'dustjs-linkedin'; import acl from '../config/acl'; dust.helpers.accessControl = function(chunk, ...

How to hide and display content in a dust template?

I am a rookie in nodejs. I am making an e-commerce site using kraken framework and dust template. I want to display Log in and Log out text depending upon the session status. My logout and login ...

dustjs OR condition over multiple parameters

I have an object with multiple properties viz propA, propB propC and propD. I want to write a condition with OR checking more than one parameter like below. {@if cond="'{obj.propA}'.length > 0 ...

Use node module in typescript enviroment

I've been trying to use the node modules 'markdown' and 'dustjs-helpers' in my angular 2.0 client side. The thing is that I couldn't reach a solution using typings (both packages are not available on ...

What would be a good approach for providing d3 capability in a dust-helper?

Right now I've been considering writing a dust-helper that renders barcharts into dust files server-side using a custom dust-helper and the d3 module for node. I was wondering if there was a better ...

Dust helper equal for select control

I have this template i need select proper selected option, how to compare it with dust helpers? http://en.stack.aiseen.org/a/19628029/880709 didn't work for me {#data.PRODUCT_TURNOVER_DATA} <tr> ...

Dust.js get call count of helper in template

So I have a dust.js helper which requires some jsx module when called and afterwards renders this module as html (some kind of plugin). {@react type="Text"\} ... <some Markup> ... {@react type="...

DustJS logic to verify empty string

I need to write logic to check whether the value is empty or it has string. Any help on this.. i tried this following. but it doesn't work in nodejs and throwing error {@if cond="'{notes}' != '' || '{...

compare multiple JSON keys against same value in dust templates

I have a JSON being passed to a Dust template and want to compare multiple keys for the same value. For example I have a JSON like: "data": { "abc": "true", "xyz": "true", "uno": "...

Async Client Side Rendering React components using Dust JS Templates

I'm having a dust helper called {@component id="compId" path="path/to/react/component"}. About React component: The react component makes an ajax call in componentWillMount and calls forceUpdate. ...

Using the dustmotes-if helper

I am loading (via requirejs) (the latest versions of) dust and dust-helpers in the following way define.amd.dust = true; require(["./Scripts/dust-full"], function (dust) { require(["./Scripts/...

Function call and checking results in DustJs

I am combining connect-roles with dust template ejs template have something like this syntax <% if (userCan('impersonate')) { %> <button id="impersonate">Impersonate</button> <%...

DustJS: Render partial via a Helper

I'm trying to abstract some code and would like to take advantage of dust.helpers to render a parial. My current setup: {> "includes/components/link" /} My ideal setup: {@uiComponent name="link"...

Dustjs OR helper

How to write below statement using dust helper? {@eq key="device" value="windows || Linux"} Your system is Windows or Linux based. {:else} Your system is MAC based. {/eq}

How to run or condition in Dust template

I am using "dustjs-helpers": "1.6.0", with "dustjs-linkedin": "^2.6.0" . In my template I need to check an OR condition like if( cherry === true || berry === true) path/to/template1/ else path/...

How to use dustjs-helpers with grunt-dust?

I'm using grunt-dust to compile dustjs templates, but now I've run into the problem that I need to use dust helpers (like @eq) which apparently grunt-dust ignores completly. I've installed dustjs-...

How to pick up a helper result in Dust.js and treat with an other helper

I have this code: {@math key="{stats}" method="divide" operand="{answers.total}"/} and I want to pick up the result of that operation and make this other action: {@math method="ceil" operand="{...
Translating... 0%