Fare riferimento al nome dell'ID univoco generato da Push in AngularJS, Firebase, AngularFire
-
21-12-2019 - |
Domanda
Come faccio a fare riferimento al modello L'ID univoco fornito quando spingo un oggetto su Firebase.
Ho questo:
-JGfp5eaDEk2_oB_Wnkc
category_id: xxxx
content: xxx
created: xxx
title: xxx
-JGfqwXgeHSksqcmeGEv
category_id: xxx
content: xxx
created: xxx
title: xxx
.
L'ho ottenuto usando:
var ref = firebaseRef('/types');
$scope.types = $firebase(ref);
.
Ora voglio creare un link nel mio modello che è simile a:
<a href="update/JGfqwXgeHSksqcmeGEv">Update</a>
. Soluzione
<ul><li ng-repeat="(key, value) in types">
<a href="update/{{key}}">Update</a>
</li></ul>
.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow