服务器端不呈现http请求[Angular Universal]

Vla*_*mir 9 angular-universal universal-cli angular

当我查看源代码时,我从apis获取http请求的任何工作人员都有问题,看起来工作人员没有从服务器上来.

所以我可以在源代码中看到静态html,但http请求中没有任何内容.

任何人都知道什么是问题?

我在用 universal-cli

编辑:

这是我的http调用示例showcode.service.ts:

import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { environment } from '../../environments/environment';

@Injectable()
export class ShowcodeService {

  constructor(private http: Http) { }

  getCode(id): any{
     return this.http.get(environment.baseUrl + 'code/show/' + id)
        .map((response: Response) => response.json());
  };

}
Run Code Online (Sandbox Code Playgroud)

这是现场的例子:http://pushsc.com/show/code/58bc83760a58d602a0b99d14检查html的源代码...它渲染evertying期待来自http的东西......

Max*_*x K 2

尝试将您的角度更新为 4.0.0。

他们修复了一些与服务器端渲染相关的错误。