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