Created
February 18, 2019 16:27
-
-
Save israeljrs/627a36803564fc34c21a897a47f18706 to your computer and use it in GitHub Desktop.
home page ts para o exemplo rxjs timeout
This file contains hidden or 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 { WebRequestService } from '../services/web-request.service'; | |
@Component({ | |
selector: 'app-home-page', | |
templateUrl: './home-page.component.html', | |
styleUrls: ['./home-page.component.scss'] | |
}) | |
export class HomePageComponent implements OnInit { | |
msg = 'Clique no botão para consulta !!!'; | |
constructor(private req: WebRequestService) { } | |
ngOnInit() { | |
} | |
btnClickRequest() { | |
this.req.getArticle().subscribe(res => { | |
this.msg = `title: ${res.title}`; | |
console.log(res); | |
}, (error) => { | |
this.msg = error.message; | |
console.log(error); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment