How to bind image in angularjs from firebase storage?
Service:
getPicture: function(ref) {
var q = $q.defer();
ref.getDownloadURL().then(function(url) {
q.resolve(url);
}).catch(function(error) {
console.log(error.code);
});
return q.promise;
}
Controller:
//retrieve an image
var imageRef = storageRef.child('images/pubCatalogo.jpg');
imageServ.getPicture(imageRef).then(function(resp){
$scope.publicidad = resp;
console.log(resp)
});
// list event data
var events = database.ref('eventsAll').child('events');
events.once('value').then(function(snapshot){
var key = snapshot.key;
var val = snapshot.val();
$scope.$apply(function(){
$scope.events = val;
});
});
`
HTML:
<div class="list card" ng-repeat="event in events">
<div class="item item-image">
<img src="{{event.image}}"> <!-- ???????? -->
</div>
</div>
The truth think how do help me please !!!