Skip to content

[Question] Compiling a template always returns a string, also when the source is different #487

@StefH

Description

@StefH

This is probably 'by design', but when calling this c# code:

var template2 = Handlebars.Compile(@"{{x}}");

var data2 = new { x = 1 };

var result2 = template2(data2);

The result is "1" (as a string), but actually it should be 1 (as a integer).

Is there any way to change this? Or is always a string returned?

See example: https://dotnetfiddle.net/b3WCwx

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions