10

I have problem to get any staff from http request from apis when I do 'view source', it looks like that staff not comming from server.

So I can see static html in source but nothing from http requests....

Anyone know what can be a problem?

I am using universal-cli

Edit:

here is example of http call from my 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());
  };

}

Here is live example: http://pushsc.com/show/code/58bc83760a58d602a0b99d14 check source code of html... It render evertying expect things that comes from http...

Vladimir
  • 1,751
  • 6
  • 30
  • 52

1 Answers1

2

Try update your angular to 4.0.0.

They fixed some bugs which was related to server side rendering.

John Doe
  • 3,794
  • 9
  • 40
  • 72
  • I'd also recommend updating to Angular 4. However, universal-cli does not work (yet) using the modules and services from `platform-server`. – Burak Tasci Mar 29 '17 at 07:22
  • 1
    I've spend half a week to get over this, and then developed an example app in order that other people do not suffer from this:https://github.com/nglibs/universal-example-app – Burak Tasci Mar 29 '17 at 07:23
  • 1
    Hi @BurakTasci can you please tell me how did you solve htis issue? the main key of the issue. Best! – BruneX Dec 23 '19 at 16:07