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 EnjoyHint with Angular #146

Open
mferuscomelo opened this issue Jul 24, 2020 · 4 comments
Open

Using EnjoyHint with Angular #146

mferuscomelo opened this issue Jul 24, 2020 · 4 comments

Comments

@mferuscomelo
Copy link

mferuscomelo commented Jul 24, 2020

Is there any way to use EnjoyHint in Angular? I tried importing it using npm, but the following error was given: Module not found: Error: Can't resolve './jquery.enjoyhint.js' in '\node_modules\xbs-enjoyhint'

Another error that is given in the console is 'ERROR Error: Uncaught (in promise): ReferenceError: global is not defined'

Any help is appreciated

@maurii90
Copy link

maurii90 commented Aug 3, 2020

Try to import from src:

import EnjoyHint from 'xbs-enjoyhint/src/enjoyhint'

@mferuscomelo
Copy link
Author

@maurii90 Thank you very much for helping! I tried to import from src, but it gave this error:
ERROR Error: Uncaught (in promise): ReferenceError: global is not defined

@DubenisLopezIMEX
Copy link

@maurii90 Thank you very much for helping! I tried to import from src, but it gave this error:
ERROR Error: Uncaught (in promise): ReferenceError: global is not defined

I have the same error.

@Hirendra786
Copy link

  1. import EnjoyHint from "xbs-enjoyhint/src/enjoyhint";
  2. Got same Error:
    global is not defined
  3. There are two way to fix
    • Edit polyfills.ts
      /*
      • APPLICATION IMPORTS
        */
        (window as any).global = window;
    • Or update this in index.html; <script> if(global === undefined) { var global = window; } </script>

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

4 participants