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

Using Halfmoon.onDOMContentLoaded() in Angular. #80

Open
ghost opened this issue Dec 11, 2020 · 2 comments
Open

Using Halfmoon.onDOMContentLoaded() in Angular. #80

ghost opened this issue Dec 11, 2020 · 2 comments
Labels
v1 Version 1.x.x

Comments

@ghost
Copy link

ghost commented Dec 11, 2020

Hello there.
I used Halfmoon in many components, and many of them required halfmoon.js to work.
I initially managed this by:

import * as halfmoon from 'halfmoon'
ngOnInit() { halfmoon.onDOMContentLoaded() }
in my app.component.ts (parent of all the components).

This works till you refresh the page, but it doesn't work with Angular Routing. Is there a better way to manage this and start halfmoon.js without writing halfmoon.onDOMContentLoaded() in every child component?

@halfmoonui
Copy link
Owner

Hey, yeah I got this wrong in the documentation. The halfmoon.onDOMContentLoaded() should be called during the first load, and after every time the route changes for SPAs. I will update this as soon as I can, and I am also looking to write a proper docs page for integrating Halfmoon with Angular.

@halfmoonui halfmoonui changed the title [ISSUE] Using Halfmoon.onDOMContentLoaded() in Angular. Using Halfmoon.onDOMContentLoaded() in Angular. Dec 14, 2020
@ghost
Copy link
Author

ghost commented Dec 14, 2020 via email

@halfmoonui halfmoonui added the v1 Version 1.x.x label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1 Version 1.x.x
Projects
None yet
Development

No branches or pull requests

1 participant