Sitecore / jss

Software development kit for JavaScript developers building web applications with Sitecore Experience Platform
https://jss.sitecore.com
Apache License 2.0
263 stars 275 forks source link

[Angular][XMC] Ensure context is available at the time of placeholder rendering #1947

Closed art-alexeyenko closed 1 month ago

art-alexeyenko commented 1 month ago

Description / Motivation

ngOnChanges executes before ngOnInit within placeholder component. This is expected (but not obvious). Considering we need metadataMode value to be available already, the context subscription is moved to constructor (can't use it in OnChanges as it's called multiple times).

Testing Details

Types of changes