, , , . , , , . ...
- :
getusers() {
this.http.get(`https://api.github.com/search/users?q=${this.input1.value}`)
.map(response => response.json().items)
.subscribe(
data => this.users = data,
error => console.log(error)
);
}
Edit
Github (developer.github.com/v3/search/#search-users), :
{
"total_count": 12,
"incomplete_results": false,
"items": [
{
"login": "mojombo",
"id": 1,
(...)
"type": "User",
"score": 105.47857
}
]
}
, items, :
getusers() {
this.http.get(`https://api.github.com/search/users?q=${this.input1.value}`)
.map(response => response.json().items)
.subscribe(
data => this.users = data,
error => console.log(error)
);
}