[{
"ASIN": "B009NPAORC",
"itemTitle": "Goliton with Andriod"
}]
在上面的代码中,我希望在ASIN
模板中获得mustache
值{{}}
。 {{}}
中的内容是什么?
答案 0 :(得分:1)
将您的价值赋予变量:
private void txtQryName_TextChanged(object sender, EventArgs e)
{
List<string> fullName = _customerBll.NameSuggestor(txtQryName.Text);
AutoCompleteStringCollection source = new AutoCompleteStringCollection();
source.AddRange(fullName.ToArray());
txtQryName.AutoCompleteMode = AutoCompleteMode.Suggest;
txtQryName.AutoCompleteSource = AutoCompleteSource.CustomSource;
txtQryName.AutoCompleteCustomSource = source;
}
我们可以使用以下方法在模板中拉出单个数组元素:
var objs = [ { "ASIN": "B009NPAORC", "itemTitle": "Goliton with Andriod" } ];
或者使用:
循环数组<li>{{objs.0.ASIN}}: {{objs.0.itemTitle}}</li>