Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server side not render http requests [Angular Universal]

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...

like image 237
Vladimir Avatar asked Mar 12 '17 00:03

Vladimir


1 Answers

Try update your angular to 4.0.0.

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

like image 50
Max K Avatar answered Nov 04 '22 09:11

Max K