3
誰かがJsonデータをHandleBarにバインドする方法を知っていますか?ここで JsonをHandlebar.Netにバインドする
はソースです:string source =
@"<div class=""entry"">
<h1>{{title}}</h1>
<div class=""body"">
{{body}}
</div>
</div>";
var template = Handlebars.Compile(source);
var data = new
{
title = "My new post",
body = "This is my first post!"
};
var result = template(data);
そして、それが正常に動作しますが、私はJSONにデータを持っているし、また、私は繰り返しを行う必要があります。私はこの例をチェックすることができ
https://github.com/rexm/Handlebars.Net html。
{"Threshold":12,"Server":[{"Name":"Machine1","CpuUsage":27,"RamUsage":62},{"Name":Machine2","CpuUsage":25,"RamUsage":57}]}
おかげ