本文整理汇总了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);
}