You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi 👋
I have encountered the following issue with this package: it is impossible to dynamically resolve URLs at runtime while still compiling using AOT.
I have a use case where the URL is resolved dynamically at runtime in a sync way. This URL may be configured by the running sub-application or it may be configured by one of web-components.
The API looks somewhat like this:
My team uses a custom package to store some data on the window object to share it between micro-frontends. This data is resolved before the application's bootstrap.
But during the compilation, Angular aggressively optimizes this value to undefined, which obviously breaks the application.
Currently, the workaround is to manually provide URLs to the directive in templates.
I think it could be fixed if elementConfigs could accept url as a function that resolves to URL value.
Could you please look into it? I'd be happy to contribute if you need any help.
The text was updated successfully, but these errors were encountered:
As you said, you can currently use directive directly , but I understand it would be nicer experience if you could also pre-configure it in a central location.
And yes the main cause of this is Angulars AOT compilation...
Static javascript function are well supported by the AOT compilation so passing one in the config should work...
As for the impl, we could check if the value is string or function and call it if its a function but it should be sync!
One more question would be if we should.support this for every prop or just make the whole config either object or a function which returns a config object which sounds more reasonable.
@gshokanov I know it is not the same thing, but there is a feature that we introduced in 10.1 that allow using import maps that allows dynamic URL definition.
Hi 👋
I have encountered the following issue with this package: it is impossible to dynamically resolve URLs at runtime while still compiling using AOT.
I have a use case where the URL is resolved dynamically at runtime in a sync way. This URL may be configured by the running sub-application or it may be configured by one of web-components.
The API looks somewhat like this:
My team uses a custom package to store some data on the window object to share it between micro-frontends. This data is resolved before the application's bootstrap.
But during the compilation, Angular aggressively optimizes this value to
undefined
, which obviously breaks the application.Currently, the workaround is to manually provide URLs to the directive in templates.
I think it could be fixed if
elementConfigs
could accepturl
as a function that resolves to URL value.Could you please look into it? I'd be happy to contribute if you need any help.
The text was updated successfully, but these errors were encountered: