10

当我执行“查看源代码”时,我无法从 api 的 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());
  };

}

这是现场示例: http: //pushsc.com/show/code/58bc83760a58d602a0b99d14检查 html 的源代码...

4

1 回答 1

1

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

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

于 2017-03-25T10:54:35.030 回答