登录 http://47.92.39.225:8080/ 查看更多文章
定义一个Angular2/4 service:
import { Injectable } from '@angular/core';
import { Http, Headers, RequestOptions, Response } from '@angular/http';
import { User } from '../_models/index';
@Injectable()
export class UserService {
constructor(private http: Http) { }
getAll() {
return this.http.get('/api/users', this.jwt()).map((res