0
已經此JSON回報我如何檢查真實條件iCanHaz(鬍鬚模板引擎)
data = [
{ firstName: "Christophe",
lastName: "Coenraets"},
{ firstName: "John",
lastName: "Smith"}
];
我想在li
列表中顯示的每個對象,並希望使用Enumerable
條件。我明白,如果它會一直喜歡
data = { elem :[
{ firstName: "Christophe",
lastName: "Coenraets"},
{ firstName: "John",
lastName: "Smith"}
]};
我可以使用類似
{{#elem}}
<li>{{firstName}} {{lastName}}</li>
{{/elem}}
但在第一種情況下,我該如何檢查的條件?