本文整理匯總了TypeScript中angular2/http.Http.get方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Http.get方法的具體用法?TypeScript Http.get怎麽用?TypeScript Http.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類angular2/http.Http
的用法示例。
在下文中一共展示了Http.get方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getTitles
getTitles(){
return this._http.get("app/test/bookTitles.txt").map( data => data.text().split('\n'));
}
示例2: getAllResults
getAllResults(){
var url = 'results/all';
return this.http.get(url)
.map(res => res.json());
}
示例3: getLastGameData
getLastGameData(gameMode: string){
var url = 'last_game_data/' + gameMode;
return this.http.get(url)
.map(res => res.json());
}
示例4: getPost
getPost(id: string) {
return this._http.get(`http://jsonplaceholder.typicode.com/posts/${id}`)
.map((response) => response.json());
}
示例5: getEvento
getEvento(id: number) {
return this.http.get(URL+id)
.map(response => response.json())
.catch(error => this.handleError(error));
}
示例6: get
get(id: number) {
return this._http.get(this.baseAPIUrl + 'user/' + id + '/', this.getHeaders()).map(res => res.json())
}
示例7: getData
getData():Observable<any> {
return this._http.get('https://sweltering-fire-7229.firebaseio.com/data.json')
.map(respone=> respone.json());
}
示例8: getInterests
getInterests(){
return this.http.get('./api/interests').map(res => {
return res.json().interests;
});
}
示例9: getNames
getNames(){
return this.http.get('./getUsers.php').map(res => {
return res.json();
});
}
示例10: getGoogleUser
getGoogleUser() {
return this.http.get('/api/google-auth/user')
.map(res => res.json())
.do((data) => localStorage.setItem('token', data.token))
.catch(this.handleError);
}