54 questions
0
votes
0
answers
58
views
Handlebars.net Pre-Compilation
We are a little confused about pre-compiling a template.
for example:
Is it possible to store the template variable in say a database and then just retrieve it and call
string source =
@"<div ...
0
votes
2
answers
122
views
Handlebars.Net inserts Japanese Characters and converts them to Unicode Decimal Code
Simple example
public class TemplateData {
public string inputstring = "あ";
}
public static string HandleBar()
{
var message = "{...
0
votes
1
answer
58
views
Difficulties printing values with Handlebars #equals in Handlebars.net
I am trying to print a tag depending on the language and the date type, so when it DateAndTime the tag should be "Delivery date and time:" and when the type is Date it should be "...
0
votes
1
answer
245
views
AddHandlebarsScaffolding with Entity Framework
I try to make a custom class with the scaffold command.
This is my model of custom class Class.hbs
{{> imports}}
{{using-base-class}}
namespace {{namespace}}
{
{{#if comment}}
/// <summary&...
0
votes
1
answer
1k
views
Handlebars.Net Each loop c#
I have a JArray that contains an array of objects. I am using handlebars.net to bind the data in the template.
In getReportDetails variable, I am getting an array of objects in the below format:
[
...
2
votes
1
answer
796
views
Is it possible for Handlebars.Net to report errors/warnings for missing properties?
Imagine that I have a template that requests {{Foo}} but that property does not exist on the given model. Can Handlebars.Net be configured to report this problem to me? To me it looks like it just ...
0
votes
1
answer
681
views
C# handlebars error in Handlebars.Compile() function
I am trying to use handlebars with C# in universal windows platform (UWP) using Handlebars.Net in this GitHub link (https://github.com/Handlebars-Net/Handlebars.Net)
I used simple code used in the ...
0
votes
0
answers
474
views
Modify automatically generated properties from .net core Entity Framework Scaffold
Our goal
To be able to use a tool that generates automatically all the models from our DB (MySQL) with Null Safety enabled (Nullable Reference Types) and that lets us modify some properties' types and ...
0
votes
1
answer
503
views
Handlebars templates for different datacontexts
I have two database contexts in the same project that look different.
One inherits from a different base class and has a different constructor.
public partial class DbFirstGraphQLDataContext : ...
0
votes
3
answers
1k
views
Handlebars.Net How to change behavior if data does not exist
In Handlebars.Net, if there is no matching field, it just places a blank there.
string source = @"My name is {{Name}} and I work at {{Job}}";
var template = Handlebars.Compile(source);
var ...
0
votes
2
answers
650
views
Provide Custom Value Binder in Handlebars.NET
I'm trying to build a code generation framework using .net core and handlebars and I would need to customize how expressions are mapped to values in handlebars.net. Is it something that is possible? ...
0
votes
2
answers
2k
views
Handlebars C# if equals comparison
I am trying to do if equals comparison on Handlebars .NET. {{#if xxx}} is working with boolean values. How can i make {{#if x = 'foo'}} comparison in Handlebars .NET ?
3
votes
1
answer
3k
views
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 ...
0
votes
1
answer
493
views
Handlebars.Net If Comparison helper not detecting argument type
Using the IfCOnd helper as defined in this post (HandleBars .Net If Comparision) I'm experiencing an issue with the helper not detecting the first argument being passed which is the particular field/...
2
votes
1
answer
336
views
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 ...
3
votes
1
answer
1k
views
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
<html>
<head>
<title>A title</title>
</head&...
2
votes
1
answer
428
views
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
{{...
1
vote
1
answer
2k
views
Handlebars.Net with local File path
I have a configuration value that represents a folder where some files are available for download. This value is a handlebars template:
"D:\{{identifier1}}\{{identifier2}}\SomeFolder\{{version}}"
...
2
votes
1
answer
615
views
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:
<select name="hour">
{{#each [1..24]}}
&...
3
votes
1
answer
1k
views
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 ...
4
votes
1
answer
2k
views
Changing the name of a generated data model property in swagger-codegen
I am generating a data model using swagger-codegen. The template
/// <summary>
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
/// <...
4
votes
2
answers
3k
views
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 =
@"<div class=""entry"">
...
2
votes
1
answer
145
views
Handlebars.net with Xamarin not working in Release
With current Xamarin.Forms 2.3.0.107, I am trying to process xml and json files with Handlebars.net (1.7.1) and Newtonsoft.json(9.0.1), while in Debug all works fine in Relase is json data not ...
2
votes
2
answers
3k
views
How to register JavaScript helpers with Handlebars.net
How would we register these two JavaScript helpers in Handlebars.Net?
For Moment.js:
Handlebars.registerHelper("formatDate", function (datetime, format) {
return moment(datetime).format(format);
...
1
vote
2
answers
2k
views
how to display property/key name in HandleBars.net
Hi this code works perfectly fine for Handlebar.js. What should I do to display key/property through c#/HandleBars.net ?
{{#each myObject}}
{{#if this.length}}
<b>{{@key}}</b>
...