Skip to content

Instantly share code, notes, and snippets.

@IAfanasovMob
Last active October 8, 2019 11:57
Show Gist options
  • Save IAfanasovMob/d38fb853c5c2dceb25ebb0bb33ce1af0 to your computer and use it in GitHub Desktop.
Save IAfanasovMob/d38fb853c5c2dceb25ebb0bb33ce1af0 to your computer and use it in GitHub Desktop.
app-component.ts
import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
userName: string;
constructor(protected http: HttpClient) {
}
loadStarred() {
this.http.get<Repo[]>(`https://api.github.com/users/${this.userName}/starred`)
.subscribe();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment