O'Reilly logo

Hands-on Full Stack Development with Angular 5 and Firebase by Uttam Agarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a friend's component

This is the main controller of our friend page. In this component, we will need to manage the navigation and visibility of our next and previous icon. We will cover the following two main things in this section:

  • Displaying the next and previous page
  • Visibility of icons

In order to display the next and previous page, we have already created the API required to display the friend's information. We have extended the OnInit interface and called getFirstPage() on ngOnInit with uid and pageSize as filter parameters, as follows:

ngOnInit() {    this.user = this.userService.getSavedUser().getValue();    this.friendService.getFirstPage(this.user.getUid() , this.pageSize)        .subscribe(friends => {            this.friends = friends; ... ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required