Last active
April 9, 2018 10:49
-
-
Save AhsanAyaz/a4ee6555a27ddfffbb7397fbf173bb87 to your computer and use it in GitHub Desktop.
AppComponent before implementing ListKeyManager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from "@angular/core"; | |
import { UsersService } from "./core/services/users.service"; | |
import { first } from "rxjs/operators"; | |
@Component({ | |
selector: "app-root", | |
templateUrl: "./app.component.html", | |
styleUrls: ["./app.component.scss"] | |
}) | |
export class AppComponent implements OnInit { | |
users: any; | |
isLoadingUsers: boolean; | |
searchQuery: string; | |
constructor(private usersService: UsersService) {} | |
ngOnInit() { | |
this.isLoadingUsers = true; | |
this.usersService | |
.getUsers() | |
.pipe(first()) | |
.subscribe(users => { | |
this.users = users; | |
this.isLoadingUsers = false; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment