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

10
  • Post your template and typescript please Commented Mar 12, 2017 at 0:09
  • What part you need? I used universal-cli created project like this ung new project Commented Mar 12, 2017 at 11:44
  • The typescript - of the http calls. Commented Mar 12, 2017 at 11:49
  • I updated my main question... Added http call from my service... Commented Mar 12, 2017 at 13:38
  • @Vladimir you are still having that issue? Commented Mar 12, 2017 at 14:15

1 Answer 1

2

Try update your angular to 4.0.0.

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

Sign up to request clarification or add additional context in comments.

3 Comments

I'd also recommend updating to Angular 4. However, universal-cli does not work (yet) using the modules and services from platform-server.
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:github.com/nglibs/universal-example-app
Hi @BurakTasci can you please tell me how did you solve htis issue? the main key of the issue. Best!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.