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

Integration in Ionic works! But I have an error 'new' keyword #139

Closed
pedros89 opened this issue Nov 13, 2020 · 4 comments
Closed

Integration in Ionic works! But I have an error 'new' keyword #139

pedros89 opened this issue Nov 13, 2020 · 4 comments

Comments

@pedros89
Copy link

pedros89 commented Nov 13, 2020

Hello,
I have managed to integrate the color picker in Ionic 5 and made a repository to show that

https://github.com/pedros89/color-picker-iro.js-in-ionic

I works ok but on Visual Studio Code (which is the IDE I'm using it gives me this error:

Only a void function can be called with the 'new' keyword.

referring to the code
var colorPicker = new iro.ColorPicker('#picker');

screenshot

@pedros89 pedros89 changed the title Integration in Ionic work! But I have an error 'new' keyword Integration in Ionic works! But I have an error 'new' keyword Nov 13, 2020
@jaames
Copy link
Owner

jaames commented Nov 13, 2020

That's strange, but it will still work if you do var colorPicker = iro.ColorPicker('#picker'); instead

@jaames jaames closed this as completed Nov 13, 2020
@pedros89
Copy link
Author

pedros89 commented Nov 13, 2020

Hi James, thank you for your reply.
Actually if I try with var colorPicker = iro.ColorPicker('#picker');

There is the following error instead

"Expected 2 arguments, but got 1."

THE PROBLEM :is that the app won't work if you close and you do "ionic serve", I think that this errors are the cause.
But I found the solution, just read the next post

Well, I am still building the app and works. I hope that during the compilation I will not have problems.
Bye the way congratulations for your color picker is the best online!!
expected 2 arguments

@pedros89
Copy link
Author

pedros89 commented Nov 14, 2020

I have actually made it work
Read the Github I read about it for more info, no more errors
https://github.com/pedros89/color-picker-iro.js-in-ionic

@jaames jaames mentioned this issue Nov 24, 2020
@pedros89
Copy link
Author

Forget about calling an external JavaScript function just use this great video for Integration in Ionic to have the Iro colorPicker in your APP.
https://www.youtube.com/watch?v=g4rQBQDUSJY

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