Skip to content
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

Params in - out to the lazy load component #9

Open
arangelp opened this issue Jul 19, 2019 · 3 comments
Open

Params in - out to the lazy load component #9

arangelp opened this issue Jul 19, 2019 · 3 comments

Comments

@arangelp
Copy link

@aaronfrost How can we pass variables and events in out to the lazy load component?

@input() etc...

@AE1NS
Copy link

AE1NS commented Apr 27, 2020

The hero-loader uses this https://github.com/herodevs/herodevs-packages/tree/master/projects/dynamic-service under the hood. So you can pass data into the component with the (init) callback of the hero-loader and call componentRef.next({YOUTDATA}); to pass the data.

@boltex
Copy link

boltex commented Nov 12, 2020

@AE1NS Could you provide a small example of this? I'm a bit newbie to all that stuff and I cannot figure where to actually call .next({some data}) also what types are the passed parameters of the init callback? a ComponentRef or a ICreatedComponentInterface ?

Edit : got it working with @input... still no successs with @output

I wish there were a clear code example somewhere to look at for using hero-loader with @output parameter that gets changed and see the changes be reflected in the lazy-loaded component.

@AE1NS
Copy link

AE1NS commented Dec 25, 2020

You should uninstall hero-loader and use this one, so you have more control inside your code + you dont need the lazyModules inside your angular.json anymore:
#26 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants