Referenciando o nome do ID exclusivo gerado por push em angularjs, firebase, angularfire
-
21-12-2019 - |
Pergunta
Como faço referência no modelo ao ID exclusivo fornecido quando envio um objeto para o Firebase.
Eu tenho isto:
-JGfp5eaDEk2_oB_Wnkc
category_id: xxxx
content: xxx
created: xxx
title: xxx
-JGfqwXgeHSksqcmeGEv
category_id: xxx
content: xxx
created: xxx
title: xxx
Eu consegui isso usando:
var ref = firebaseRef('/types');
$scope.types = $firebase(ref);
Agora quero criar um link em meu modelo que seja algo como:
<a href="update/JGfqwXgeHSksqcmeGEv">Update</a>
Solução
<ul><li ng-repeat="(key, value) in types">
<a href="update/{{key}}">Update</a>
</li></ul>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow