Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Didn't get output from Angular cloud Firestore using routerLink #2

Open
rijomonr opened this issue Nov 7, 2017 · 4 comments
Open

Comments

@rijomonr
Copy link

rijomonr commented Nov 7, 2017

https://stackoverflow.com/questions/47149153/didnt-get-output-from-angular-cloud-firestore-using-routerlink

@sggonzalezg
Copy link

Any suggestion?
When I go back, from an add form the list disappear

Thanks

@rangiesrule
Copy link

Hi,
This setup has helped me out, so thanks.
I also trying to add a router arrangement with home '/' page that navigates to '/items' where the list is. Works the first time, then navigating back to home '/' and back into '/items', the list does not re-appear, just displays the "There are no items...'.

Not sure where to look.

@Rugleh
Copy link

Rugleh commented Dec 6, 2017

Hi @rangiesrule, did you resolve this issue?
I have the same problem right now and I think is related to the async pipe that is not called in the *ngFor.
when I add the async no items are displayed at all not even at the first time loading, and the error is the following one:

ItemsComponent.html:9 ERROR Error: InvalidPipeArgument: '[object Object],[object Object],[object Object],[object Object],[object Object]' for pipe 'AsyncPipe'

Probably the error it's in the item component when the item service is called and is subscribed to getItems() inside ngOnInit()

@chris-cli
Copy link

I don't know if this is the best way but I unsubscribed from the itemService in ngOnDestroy... so roughly this in the item component..

export class ItemsComponent implements OnInit, OnDestroy {
.....
subscribedData: Subscription;
}

ngOnInit() {
this.subscribedData = this.itemService.getItems().subscribe(items .....
....
}

ngOnDestroy(): void {
this.subscribedData.unsubscribe();
}

After doing this the data reloads on routerLink navigation...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants