Skip to content

Astro AnalogJs Input Params are undefined in ngOnInit on SSR #1879

@LuepoldMartin

Description

@LuepoldMartin

Please provide the environment you discovered this bug in.

https://stackblitz.com/edit/github-qfeekc5j-ygz1jywz?file=src%2Fpages%2Findex.astro

Which area/package is the issue in?

astro-angular

Description

I need to load data by an Input param coming from astro. Normally in Angular, input params are available in OnInit as onChanged is run before onInit. But when running astro and Analogjs, input params are only resolved after ngOnInit (in ngOnChanges) on server side. Client side is correct.

See reproduction on Stackblitz and see log: https://stackblitz.com/edit/github-qfeekc5j-ygz1jywz?file=src%2Fpages%2Findex.astro

Please provide the exception or error you saw

param Input is undefined in ngOnInit

ngOnInit undefined
ngAfterViewInit undefined
ngAfterViewChecked undefined
Angular is running in development mode.
ngAfterViewChecked undefined
ngOnChanges hello
ngAfterViewChecked hello
ngAfterViewChecked hello

should be
ngOnChanges hello
ngOnInit hello
ngAfterViewInit hello
ngAfterViewChecked hello

Other information

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions