我有一个FirebaseListObservable被循环并且列表中的单个对象被传递,我如何获得通过的对象的键值?如何从数组中的单个对象获取密钥?
对象的单个实例被选中时传递给该函数,我需要获取该键,但是如果使用value.key或value.uid,则它是未定义的。
这是不通过火力点阵列循环
<sebm-google-map-marker
*ngFor="let m of markers | async"
(markerClick)="test(m)"
[latitude]="m.lat"
[longitude]="m.lng"
>
当这个点击的功能是
test(m){
var things=m;
console.log(m.val());}
我想获得该项目的重点是通过
this is the data being passed and want to get the key for the object
请分享一些代码示例为他人理解 – abeyaz
@abeyaz你去那里谢谢你告诉我 –
能告诉你填充组件的'marker'属性的代码?我认为一种解决方案可能是在从Firebase后端加载存储在** marker **对象中的项**键**时。 – Picci