Chrome 56.0.2924.87 and win10
first way of reproducing the behaviour
```ts
import { Component, Inject, NgModule, Input } from '@angular/core'
import { AngularFire, FirebaseApp, FirebaseListObservable, AuthProviders, AuthMethods } from 'angularfire2';
@Component({
selector: 'my-people',
template: `
<div *ngFor="let obj of objectives | async">
objective: {{ obj ?.name }} {{ obj?.$key }}
</div>
`,
})
export class PeopleComponent {
images: any[];
uid: string;
objectives: FirebaseListObservable
this.af.auth.subscribe(auth => {
if (auth) {
this.uid = auth.uid;
this.objectives = this.af.database.list(`/users/${this.uid}/objectives`);
this.af.database.list(`/users/${this.uid}/images`).subscribe(data => {
this.images = data;
});
}
});
}
}
**second way of reproducing the behaviour**
ts
import { Component, Inject, NgModule, Input } from '@angular/core'
import { AngularFire, FirebaseApp, FirebaseListObservable, AuthProviders, AuthMethods } from 'angularfire2';
@Component({
selector: 'my-people',
template:
<div *ngFor="let obj of objectives | async">
objective: {{ obj ?.name }} {{ obj?.$key }}
</div>
,
})
export class PeopleComponent {
images: any[];
uid: string;
objectives: FirebaseListObservable
this.af.auth.subscribe(auth => {
if (auth) {
this.uid = auth.uid;
this.objectives = this.af.database.list(`/users/${this.uid}/objectives`);
// this.af.database.list(`/users/${this.uid}/objectives`).subscribe(data => {
//nothing here
//but somehow this make it working offline
//});
}
});
}
}
```
Steps to set up and reproduce
the goal here was to test the offline behaviour of angularfire2 and I was surprised to see that when I went offline reloading a component with an ngFor async on the FirebaseListObservable would erase my bindings except if go though the subscribe method.
first way of reproducing the behaviour
second way of reproducing the behaviour
this also happen if you follow these steps
Sample data and security rules
Security open for all !
* Errors in the JavaScript console *
* Output from firebase.database().enableLogging(true); *
* Screenshots *
first way of reproducing the behaviour


second way of reproducing the behaviour


when offline the async pipe binding should work without the use of calling the subscribe method
offline the async pipe binding does not work without the use of calling the subscribe method
Is the tab component using the RouteReuseStrategy or something to keep the components from being torn down? If so, the list that uses subscribe would have a cached copy in the component - that is, in the property that's assigned to inside the subscribe. When change detection is triggered, the subscribed component would have the cached list and the other would have an observable that would not emit anything.
If that's what's happening, it's the expected behaviour, I guess. Otherwise, I think you'll need to create a Plunk - using the template - for this to be investigated.
@cartant if you take a look at the second way to reproduce the behavious
I don't do anything inside the subscribe method so I don't think something is cached.
I am simply using material2 tab nav bar like this
<nav md-tab-nav-bar>
<a md-tab-link routerLink="/login" routerLinkActive #rla="routerLinkActive" [active]="rla.isActive">Login</a>
Okay, this is what I believe is happening:
subscribe but you never call unsubscribe on the returned subscription.on method.unsubscribe is not called).OnDestroy in the component and call unsubscribe on the subscription returned by subscribe, the cache won't be used and it will behave the same as with the async pipe.and the winner is @cartant :sunglasses: when implementing the unsubscribe the data is not cached.
thanks so much for your help
by the way I will implement a RouteReuseStrategy . This way I can use the async pipe (and let it subscribe unsubscribe ) and when I will be navigating the component will not be destroyed.
btw you can close this issue
Most helpful comment
Okay, this is what I believe is happening:
subscribebut you never callunsubscribeon the returned subscription.onmethod.unsubscribeis not called).OnDestroyin the component and callunsubscribeon the subscription returned bysubscribe, the cache won't be used and it will behave the same as with theasyncpipe.