-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion Extending LazyElementModuleOptions
#23
Comments
@BioPhoton welcome bro! |
@BioPhoton so this is about single bundle having multiple elements, wouldn't in that case make more sense to have something like When you first described feature to me the way I understood it then was more like
And then if tag is Also in theory, if you pre-load your bundle "many-elements" bundle you could just use element tag as is without This concept is used in one of the examples ( What are your thoughts... I think it can still make sense to have this, just thinking about all the possible trade-offs, thanks for the request! |
But I mean I can directly use it in the template and have to maintain the tag name only in the template if there would be a defaultUrl. |
Would this not work? having @Component({
selector: 'your-org-feature',
template: `
<element-one></element-one>
<element-two></element-two>
<element-three></element-three>
<special-element *axLazyElement></special-element>
`
})
export class FeatureComponent {} |
So as soon as i put it in the config it preloads? I thought I can trigger it with putting the directive there. 🤔 |
@BioPhoton it depends... Have to add more examples in the demo to show it off. Currently, there are 2 ways to preload, one is to use service which is fully in control of the DEV, eg preload in route guard, preload on click, whatever... Even though triggering preloading is just that, we're currently not returning promise or anything (which we should @mohammedzamakhan ) so you don't really know if stuff was fully preloaded yet... Similar to that, specifying If we had an guarantee that the element was fully preloaded before it appears in the template, then we could just use With directive we have a guarantee that the element was loaded, and was loaded only once because the directive would get pending promise from the registry if the element loading was already triggered but not yet resolved (eg by preloading) |
Suggestion Extending to extend
LazyElementModuleOptions
withdefaultURL
Suggestion To Implement a new option
defaultURL
When I load elements from different sources and let's say one source is a bundle of 10 web components and another one is a bundle of one web component I could save some configuration by having a default URL.
If the tag to load is not referenced in
elementConfigs
it automatically falls back to the configured default URL.This could save in the above-mentioned example 10 lines of configuration.
Actual Behaviour
app.module.ts
app.component.ts
Suggested Behaviour
app.module.ts
app.component.ts
The text was updated successfully, but these errors were encountered: