Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosh-hamedani committed Jul 25, 2017
1 parent c652730 commit 385c653
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 87 deletions.
4 changes: 1 addition & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { AboutComponent } from './about/about.component';
import { NavbarComponent } from './navbar/navbar.component';
import { GithubFollowersComponent } from './github-followers/github-followers.component';

import { GithubFollowersService } from './services/github-followers.service';
import { DataService } from './services/data.service';
import { GithubFollowersService } from './github-followers/github-followers.service';

@NgModule({
declarations: [
Expand All @@ -29,7 +28,6 @@ import { DataService } from './services/data.service';
])
],
providers: [
DataService,
GithubFollowersService
],
bootstrap: [AppComponent]
Expand Down
4 changes: 2 additions & 2 deletions src/app/github-followers/github-followers.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ActivatedRoute } from '@angular/router';
import { GithubFollowersService } from './../services/github-followers.service';
import { GithubFollowersService } from './github-followers.service';
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/combineLatest';
Expand Down Expand Up @@ -27,7 +27,7 @@ export class GithubFollowersComponent implements OnInit {
let id = combined[0].get('id');
let page = combined[1].get('page');

return this.service.getAll();
return this.service.getFollowers();
})
.subscribe(followers => this.followers = followers);
}
Expand Down
15 changes: 15 additions & 0 deletions src/app/github-followers/github-followers.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Http } from '@angular/http';
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';

@Injectable()
export class GithubFollowersService {
private readonly _url = 'https://api.github.com/users/mosh-hamedani/followers';

constructor(private http: Http) { }

getFollowers() {
return this.http.get(this._url)
.map(response => response.json());
}
}
56 changes: 0 additions & 56 deletions src/app/services/data.service.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/app/services/github-followers.service.spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/app/services/github-followers.service.ts

This file was deleted.

0 comments on commit 385c653

Please sign in to comment.