Skip to content

Instantly share code, notes, and snippets.

@AhsanAyaz
Last active April 9, 2018 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AhsanAyaz/a4ee6555a27ddfffbb7397fbf173bb87 to your computer and use it in GitHub Desktop.
Save AhsanAyaz/a4ee6555a27ddfffbb7397fbf173bb87 to your computer and use it in GitHub Desktop.
AppComponent before implementing ListKeyManager
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