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

could't use fancybox-plus in angular 8 #11

Open
yesimd opened this issue Nov 11, 2020 · 2 comments
Open

could't use fancybox-plus in angular 8 #11

yesimd opened this issue Nov 11, 2020 · 2 comments

Comments

@yesimd
Copy link

yesimd commented Nov 11, 2020

Hi I installed fancybox in an angular 8 project via npm and then try to use it. There are several version of this lib. I followed the instructions in the page which forwarded from this project. But it didn't work for me. Would you please tell how to use this directive in angular 2+ component with a small example. Thanks in advance.

@igorlino
Copy link
Owner

igorlino commented Nov 11, 2020

The docu from the plain jquery, is for plain html pages.

The docu for angular 1.x has a different architecture. (https://github.com/igorlino/angular-fancybox-plus)

I believe you can use it, but fancybox-plus is a jquery based plugin. Which modifies the DOM outside of the lifecycle of angular 2.x or higher.

That means, you need to:

  • include fancy-box and jquery as npm dependency,

  • use the right code when your component has been initialized. onAfterViewInit

-destroy the fancybox when the component is destroyed.

Sorry, no time to create a newer example.

@yesimd
Copy link
Author

yesimd commented Nov 12, 2020

The docu from the plain jquery, is for plain html pages.

The docu for angular 1.x has a different architecture. (https://github.com/igorlino/angular-fancybox-plus)

I believe you can use it, but fancybox-plus is a jquery based plugin. Which modifies the DOM outside of the lifecycle of angular 2.x or higher.

That means, you need to:

  • include fancy-box and jquery as npm dependency,
  • use the right code when your component has been initialized. onAfterViewInit

-destroy the fancybox when the component is destroyed.

Sorry, no time to create a newer example.

Hi, thanks for reply. Actually I already did this steps. I want to show an html element in the fancybox. But I could't find any example for that purpose especially foe angular version. Could you please give little info about syntax.

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