File tree 4 files changed +116
-5
lines changed
src/app/pages/user-search
4 files changed +116
-5
lines changed Original file line number Diff line number Diff line change
1
+ import { User } from "./user" ;
2
+
3
+ export class Repo {
4
+ id : number ;
5
+ node_id : string ;
6
+ name : string ;
7
+ full_name : string ;
8
+ private : false ;
9
+ owner : User ;
10
+ html_url : string ;
11
+ description : string ;
12
+ fork : boolean ;
13
+ url : string ;
14
+ forks_url : string ;
15
+ keys_url : string ;
16
+ collaborators_url : string ;
17
+ teams_url : string ;
18
+ hooks_url : string ;
19
+ issue_events_url : string ;
20
+ events_url : string ;
21
+ assignees_url : string ;
22
+ branches_url : string ;
23
+ tags_url : string ;
24
+ blobs_url : string ;
25
+ git_tags_url : string ;
26
+ git_refs_url : string ;
27
+ trees_url : string ;
28
+ statuses_url : string ;
29
+ languages_url : string ;
30
+ stargazers_url : string ;
31
+ contributors_url : string ;
32
+ subscribers_url : string ;
33
+ subscription_url : string ;
34
+ commits_url : string ;
35
+ git_commits_url : string ;
36
+ comments_url : string ;
37
+ issue_comment_url : string ;
38
+ contents_url : string ;
39
+ compare_url : string ;
40
+ merges_url : string ;
41
+ archive_url : string ;
42
+ downloads_url : string ;
43
+ issues_url : string ;
44
+ pulls_url : string ;
45
+ milestones_url : string ;
46
+ notifications_url : string ;
47
+ labels_url : string ;
48
+ releases_url : string ;
49
+ deployments_url : string ;
50
+ created_at : string ;
51
+ updated_at : string ;
52
+ pushed_at : string ;
53
+ git_url : string ;
54
+ ssh_url : string ;
55
+ clone_url : string ;
56
+ svn_url : string ;
57
+ homepage : string ;
58
+ size : number ;
59
+ stargazers_count : number ;
60
+ watchers_count : number ;
61
+ language : string ;
62
+ has_issues : boolean ;
63
+ has_projects : boolean ;
64
+ has_downloads : boolean ;
65
+ has_wiki : boolean ;
66
+ has_pages : boolean ;
67
+ forks_count : number ;
68
+ mirror_url : string ;
69
+ archived : boolean ;
70
+ disabled : boolean ;
71
+ open_issues_count : number ;
72
+ license : { } ;
73
+ forks : number ;
74
+ open_issues : number ;
75
+ watchers : number ;
76
+ default_branch : string ;
77
+ }
Original file line number Diff line number Diff line change
1
+ export class User {
2
+ login : string ;
3
+ id : number ;
4
+ node_id : string ;
5
+ avatar_url : string ;
6
+ gravatar_id : string ;
7
+ url : string ;
8
+ html_url : string ;
9
+ followers_url : string ;
10
+ following_url : string ;
11
+ gists_url : string ;
12
+ starred_url : string ;
13
+ subscriptions_url : string ;
14
+ organizations_url : string ;
15
+ repos_url : string ;
16
+ events_url : string ;
17
+ received_events_url : string ;
18
+ type : string ;
19
+ site_admin : boolean ;
20
+ name : string ;
21
+ company : string ;
22
+ blog : string ;
23
+ location : string ;
24
+ email : string ;
25
+ hireable : string ;
26
+ bio : string ;
27
+ public_repos : number ;
28
+ public_gists : number ;
29
+ followers : number ;
30
+ following : number ;
31
+ created_at : string ;
32
+ updated_at : string ;
33
+ }
Original file line number Diff line number Diff line change 22
22
</ ion-buttons >
23
23
</ ion-item >
24
24
</ ion-list >
25
- < ion-card *ngFor ="let repo of repoList $ | async; let index = index; ">
25
+ < ion-card *ngFor ="let repo of repos $ | async; let index = index; ">
26
26
< ion-card-header > {{ repo.name }} </ ion-card-header >
27
27
< ion-card-content > {{ repo.description }} </ ion-card-content >
28
28
</ ion-card >
Original file line number Diff line number Diff line change 1
1
import { GithubService } from "./../../services/github.service" ;
2
2
import { Component , OnInit } from "@angular/core" ;
3
3
import { Observable } from "rxjs" ;
4
+ import { Repo } from "./models/repo" ;
4
5
5
6
@Component ( {
6
7
selector : "app-user-search" ,
@@ -10,15 +11,15 @@ import { Observable } from "rxjs";
10
11
} )
11
12
export class UserSearchPage implements OnInit {
12
13
results : Observable < any > ;
13
- public repoList$ ;
14
- public username ;
14
+ public repos$ : Observable < Repo [ ] > ;
15
+ public username : string ;
15
16
16
17
constructor ( private githubService : GithubService ) { }
17
18
18
19
ngOnInit ( ) { }
19
20
20
21
getRepos ( ) : void {
21
- this . repoList $ = this . githubService . getRepos ( this . username ) ;
22
- console . log ( this . repoList $. subscribe ( ( x ) => console . log ( x ) ) ) ;
22
+ this . repos $ = this . githubService . getRepos ( this . username ) ;
23
+ console . log ( this . repos $. subscribe ( ( x ) => console . log ( x ) ) ) ;
23
24
}
24
25
}
You can’t perform that action at this time.
0 commit comments