我有一个独立的NodeJS RESTful api和单独的角4接口。我可以通过提供路径将从接口提交的数据传递给RESTful api吗?
发布于 2017-11-13 20:07:34
您尝试过打电话,提供如下服务:
import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';
import {Observable} from 'rxjs/Rx';
@Injectable()
export class YourService {
constructor(private http:Http) { }
// Uses http.get() to communicate with NodeJs
getSomeThing() {
return this.http.get('yourAPIUrl').map((res:Response) => res.json());
}
}https://stackoverflow.com/questions/47272264
复制相似问题