Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

ssr rerender dont wait until the second round of callbacks / async #665

Open
aiqoo opened this issue Feb 12, 2019 · 0 comments
Open

ssr rerender dont wait until the second round of callbacks / async #665

aiqoo opened this issue Feb 12, 2019 · 0 comments

Comments

@aiqoo
Copy link

aiqoo commented Feb 12, 2019

Bug Report

I run into a problem when I attempt to prerender a dynamic page that uses the returned data from a service using a JSON file.

It seems it does not wait until the second round of callbacks / async actions are done and rerenders a version without the data that is returned from the service.

in constructor...

this._articlesService.getArticleData(this.articleID).subscribe(
            (data) => {
                this.articleSettings = data;
                //console.log(data);
                this.articlesInitOnStart();
            },
            (err) => {
                console.log(err);
            }
        );


in ArticlesService....

getArticleData(articleID: number): Observable<any> {

        return this.httpClient.get<any>("./assets/data/articles/" + articleID + ".json")
            .pipe(catchError(this.handleError));
    }

What modules are related to this issue?

- [ +] express-engine

Environment:

  • express-engine:
<!--
Output from: `ng --version`.
Angular CLI: 7.2.4
Node: 10.14.0
OS: win32 x64
Angular: 7.2.4
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.12.4
@angular-devkit/build-angular     0.12.4
@angular-devkit/build-optimizer   0.12.4
@angular-devkit/build-webpack     0.12.4
@angular-devkit/core              7.2.4
@angular-devkit/schematics        7.2.4
@ngtools/webpack                  7.2.4
@schematics/angular               7.2.4
@schematics/update                0.12.4
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.28.4


node --version: v10.14.0
npm --version: 6.7.0.
  Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
-->
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants