Questions tagged [handlebars.net]

Handlebars.Net is a .NET-native implementation of the handlebars.js template library.

Handlebars.Net is a -native implementation of the handlebars Javascript template library.

References:

53 questions
7
votes
4 answers

HandleBars .Net If Comparision

I use Handlebars .NET for my mail templates so i generate template at server side width ASP.NET MVC. I need a comparision like this. But it doest't work? What can I do? //Product.ProdType is a enum property {{#if…
Yargicx
  • 1,704
  • 3
  • 16
  • 36
6
votes
1 answer

What's the syntax for creating HandleBars helpers server side?

Using Handlebars.Net, I'd like to create a HandlebarsHelper that will replace carriage returns and newlines with
tags. It should look something like this: string pattern = @"/(\r\n|\n|\r)/gm"; string replacement = "
"; Regex rgx = new…
BobbyA
  • 2,090
  • 23
  • 41
4
votes
1 answer

Changing the name of a generated data model property in swagger-codegen

I am generating a data model using swagger-codegen. The template /// /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} /// {{#description}} ///…
taj
  • 1,128
  • 1
  • 9
  • 23
3
votes
1 answer

Handlebars.Net If Condition Helper

I try to write a Handlebar.Net helper which works like Equals. The Helper should be used like {{#eq name "Foo"}} true {{else}} false {{/eq}} But I don´t know how to implement this helper. In JS there is this example but I can´t find an…
Felix Arnold
  • 839
  • 7
  • 35
3
votes
1 answer

Cannot compile template with Lookup helper - signature or security transparency is not compatible

I'm trying to use the following template (TestTemplate) in a console application using .NET Core 2.1 and Handlebars.Net 1.9.5 A title {{ > (lookup TemplateName)}} So the line…
bluedot
  • 628
  • 8
  • 24
3
votes
1 answer

Handlebars JS get the subarray item using variable

I have json with an array of objects which each object has its own sub array. I want to grab the values from _History sub array using the value in _Year variable I pass into Handlebars js. I can get it to work if I set the value directly into the…
Kathy Judd
  • 715
  • 3
  • 9
  • 21
3
votes
2 answers

Binding json to Handlebar.Net

Does someone know how to bind Json data to HandleBar? Here is the source: https://github.com/rexm/Handlebars.Net I could check this example: string source = @"

{{title}}

Mati Silver
  • 185
  • 1
  • 13
3
votes
2 answers

Handlebars.net disable escaping with noEscape option in

I just found this link to escape html in string with Handlebars.js: Handlebars.js disable escaping with noEscape option? i.e var template = Handlebars.compile(source, {noEscape: true}); I am using Handlebars.Net in my project and I want to use the…
Raghav
  • 8,772
  • 6
  • 82
  • 106
2
votes
1 answer

Handlebars.net: Reached end of template before block expression 'currency' was closed

I have a template that looks like this: (I removed some elements of the table just to keep the code short) {{#each Tables}}
Brandon
  • 830
  • 1
  • 15
  • 35
2
votes
1 answer

Handlebars DateTimeFormat Helper

I want to display a Datetime as MM-yy format with Handlebars and found the Moment-Helpen but its JS not C# in NuGet there is Moment.js which we can install but don´t know how to use it. The solution should be something like:
{{formatTime…
Felix Arnold
  • 839
  • 7
  • 35
2
votes
0 answers

How to keep expressions in HandleBars.Net for later evaluation?

This seems to be a simple matter and maybe it's solved already, but I'm not sure how to do it. I'd like to keep arbitrary unresolved expressions for later evaluation. Note that I still don't know which expressions are already defined. For example,…
Rubem Pechansky
  • 185
  • 2
  • 7
2
votes
1 answer

Handlebars.net not preserving white space

I have the following template: {{>Header}} This is a test template. {{>Footer}} When I compile this template, I'd expect to get this: This is a header. …
user3678429
  • 258
  • 1
  • 3
  • 9
2
votes
1 answer

Handlebars.net Accessing collections with indexers

In handlebars.net, I know we can access array members like {{SomeArray.0}} Is it possible to access collection items through indexers like {{SomeCollectionInstance['key']}} or {{SomeCollectionInstance.key}} If not possible, can anyone propose a…
Onur Okyay
  • 190
  • 1
  • 10
2
votes
0 answers

@last element in nested each (Handlebars) C#

I try to dump array with objects to csv file. Each object is a row with values. {{#unless @last}};{{/unless}} block in nested loop is interpreted as a last parent element. There is a code for LinqPad: void Main() { string template = "{{#each…
Igor
  • 1,589
  • 15
  • 15
2
votes
1 answer

Can you create an array and iterate over it in a handlebars template?

In handlebars.js or handlebars.net, is there a way to create an array and iterate over it in the template? I would like to do something like this: I…
1
2 3 4