You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
I think it's because you are not returning the subscription on obterCondutorPeloUsuarioLogado() method.
You are subscribing to the AfoListObservable called obs, but when you return obs, you are not returning the subscription, but only the AfoListObservable reference.
To solve the problem, you should subscribe just on client method, like this:
const subscription = this.fatguysService.obterCondutorPeloUsuarioLogado().subscribe(condutor => {
// Do whatever you need to do with data
});
After that, you'll be able to unsubscribe (subscription.unsubscribe()).
I can't unsubscribe from AfoListObservable when I query it because its subscription method always returns undefined.
I have a provider method that querys a list:
Code is bellow:
`
obterCondutorPeloUsuarioLogado(){
}
`
Here is my component code subscribing to the list query:
`
let ref= this.fatguysService.obterCondutorPeloUsuarioLogado();
if(ref!=null){
if(this.loading==null){
this.loading = this.loadingCtrl.create({
content: 'Buscando condutor...'
});
}
else{
this.loading.setContent("Buscando condutor...");
}
this.loading.present().then(
_=>{
const sub =
ref.subscribe(
r=>{
sub.unsubscribe();
`
This last line always throws an error cannot read property unsubscribe of undefined.
I noticed that if I comment out the following lines, it works:
// obs.subscribe(condutor=>{
// this.condutor=condutor[0];
// });
The text was updated successfully, but these errors were encountered: