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

why Jquery is used inside sdk.ts? #3

Open
ahmadkhalaf1 opened this issue Feb 14, 2018 · 2 comments
Open

why Jquery is used inside sdk.ts? #3

ahmadkhalaf1 opened this issue Feb 14, 2018 · 2 comments

Comments

@ahmadkhalaf1
Copy link

Hello ,

as i can see that jquery is used inside sdk.ts file . since we are using angular2 why do we need jquery and using it inside this file ?

@oanguenot
Copy link
Contributor

Hi Ahmad,

After checking our code, there are two things:

  • First, internally, our SDK is based on Angular 1 and use Jquery as a helper. So to work, you need to load Jquery as a dependency.

  • Regarding events, currently, if you are not building an Angular 1 application, you need Jquery to listen to the events because internally, we use the method $(document).trigger().

Due to a bug in JQuery that has never been fixed (https://bugs.jquery.com/ticket/11047), it is not possible to listen to Jquery events without Jquery. document.addEventListener(...) method is not able to catch Jquery event.

CustomEvent could be an alternative but we need to see how to introduce it without breaking change or with limited breaking change.

Hope this will help to understand why JQuery has to be used.

@ahmadkhalaf1
Copy link
Author

Thank you for the explanation 👍

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