引用推动在AngularJS,Firebase,AngularFire中生成的唯一ID的名称
-
21-12-2019 - |
题
如何引用模板时,当我将对象推到Firebase时提供的唯一ID。
我有这个:
-JGfp5eaDEk2_oB_Wnkc
category_id: xxxx
content: xxx
created: xxx
title: xxx
-JGfqwXgeHSksqcmeGEv
category_id: xxx
content: xxx
created: xxx
title: xxx
.
我通过使用:
var ref = firebaseRef('/types');
$scope.types = $firebase(ref);
.
现在我想在我的模板中创建一个链接,这是:
<a href="update/JGfqwXgeHSksqcmeGEv">Update</a>
. 解决方案
<ul><li ng-repeat="(key, value) in types">
<a href="update/{{key}}">Update</a>
</li></ul>
.
不隶属于 StackOverflow