I have a Application where I try to include Firebase. I got it work so far but the way I included the get request in my controller my script just continue without waiting for the data. I would like to convert my request into a request with a promise.
something similar as I used before with normal $http requests:
$http(http_req).then(function mySucces(data) {
// Success
}, function myError(data) {
//something was wrong
});
Thank you for your help @A_Burgess, but unfortunately this is not working.
I posted your code and I get error āionic.bundle.js:25642 TypeError: firebase.database(ā¦).ref(ā¦).then is not a functionā
I did read the docs up and down, and it is also working as described in the docs but these are not any actions with promises. In there examples everything works like in my example but what I donāt get done is a proper error handling and/or get it work so the script does wait for firebase before it continues.
What I am looking for is a way to receive data from firebase BUT wait for the result before I continue AND catch errors if any happen. (like missing data, no connection etc.)