Adds proper Newtonsoft.Json support to Handlebars.Net
dotnet add package Handlebars.Net.Extension.NewtonsoftJson
var handlebars = Handlebars.Create(); handlebars.Configuration.UseNewtonsoftJson();
[Fact] public void JsonTestObjects() { var model = JObject.Parse("{\"Key1\": \"Val1\", \"Key2\": \"Val2\"}"); var source = "{{#each this}}{{@key}}{{@value}}{{/each}}"; var handlebars = Handlebars.Create(); handlebars.Configuration.UseNewtonsoftJson(); var template = handlebars.Compile(source); var output = template(model); Assert.Equal("Key1Val1Key2Val2", output); }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4