在聚合物中,我正在阅读 Firebase 表。我可以填充对象并检索数据。但我不知道如何从 JSON 中获取文档名称...
这是我的数据示例...
{
"PF004" : {
"BINTS01" : 1477921088227,
"BINTS02" : "2016-10-31 09:38",
"BinScanWeekNumber" : 45,
"DriversInitials" : "lt",
"MissionID" : "lt1477921031516",
"Q10_FILL_LEVEL" : "01 - 010% -2",
"Q20_BIN_STATUS" : "300 - ALL GOOD",
"ValLat" : 27.0026283,
"ValLong" : -82.1632471,
"YearNumber" : 2016,
"recorded" : false
},
"PF009" : {
"BINTS01" : 1477938700818,
"BINTS02" : "2016-10-31 14:31",
"BinScanWeekNumber" : 45,
"DriversInitials" : "lt",
"MissionID" : "lt1477935967751",
"Q10_FILL_LEVEL" : "09 - 090% -5",
"Q20_BIN_STATUS" : "300 - ALL GOOD",
"ValLat" : 27.4861796,
"ValLong" : -82.4469888,
"YearNumber" : 2016,
"recorded" : false
},
在 Chrome 调试器中,我得到了这个......“Firebase child_added: PF004”
所以我知道 chrome see 就是这个。我正在寻找一种打印文档 ID 的方法。
这是我到目前为止所尝试的......
<div class="card-content">BIN = [[bin.ID]] </div>
<div class="card-content">BIN = [[bin.id]] </div>
<div class="card-content">BIN = [[bin.child_added]] </div>
我通常在做Android和ObjC的东西......我真的应该比这更了解JS......谢谢......