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

Accessing child elements #411

Open
dolanmiu opened this issue Jul 7, 2021 · 1 comment
Open

Accessing child elements #411

dolanmiu opened this issue Jul 7, 2021 · 1 comment

Comments

@dolanmiu
Copy link

dolanmiu commented Jul 7, 2021

It is not possible to add joyRide in child or nested components.

For example, if I have a page, Joyride works fine, but it cannot see the child components. E.g. The Nav Bar

Similar Ticket

#61

@CodeMagic
Copy link
Contributor

If you need a joyride step added to a component template you've written, it can be done. I don't know if it's strictly best practice, but here you go: https://stackblitz.com/edit/angular-ivy-hwqnb7?file=src/app/app.component.html

I got this working with three main parts:

  • an anchor directive you place in your component template, which grabs a ViewContainerRef of the element you place it on
  • a ViewChildren query list to expose those anchors
  • a directive you place on a component from the page, which collects all the necessary info, then creates a new JoyrideDirective from TypeScript.

If you need a joyride step added to a 3rd party component template... I got nothing.

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

2 participants