我有一個從XML轉換,並保持「@屬性」一個JSON得到JSON @屬性項:如何在流星模板
{"stop":"1021","route":"0057","direction":"1","departures":{"departure":[
{"@attributes":{"accurate":"1","headsign":"Rennes R"},"content":"2013-03-25T12:00:23+01:00"},
{"@attributes":{"accurate":"0","headsign":"Rennes R"},"content":"2013-03-25T12:20:00+01:00"},
{"@attributes":{"accurate":"0","headsign":"Rennes R"},"content":"2013-03-25T12:40:00+01:00"}]}},...
你可以在這裏訪問的JavaScript性能[1]與:
departure[0]["@attributes"].accurate
但如果你想在流星的模板中抓住它,你怎麼做到這一點?
[1] JSON @attributes
我有張貼我自己的答案:(之前等待7小時 - >解決方案是在這裏:http://bit.ly/YstER0 – 2013-03-26 09:06:05
也許最好不要縮短網址並提供一些披露,你鏈接到自己的網站 – Swadq 2013-03-26 10:45:24
@Swadq評論是有限的長度,我會把全部內容作爲答案在這裏1小時;) – 2013-03-26 16:05:33