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

colorpicker-closed not fired #152

Open
Lulunx opened this issue Sep 27, 2017 · 2 comments
Open

colorpicker-closed not fired #152

Lulunx opened this issue Sep 27, 2017 · 2 comments

Comments

@Lulunx
Copy link

Lulunx commented Sep 27, 2017

Hi, ( Sorry my english could be bad )

I'm using the colorpicker for a personnal developement, and I've actually a problem.

I want to send a request in a API when the user close the colorpicker ( I don't want to send it when the color change for don't flood the server ).

For that, I used the colorpicker-closed attribute like that

<button class="ui basic green fluid button" colorpicker type="button" colorpicker-size="200" colorpicker-closed="switchColor()" colorpicker-position="top" ng-model="color.color">Couleur</button>

The function switchColor(), is actually doing only a console.log() ( For debug ! )

$scope.switchColor=function(){ console.log('Test') }

But the close event is never triggered.
If someone could help me ?

Thanks
Lucas

@llevii
Copy link

llevii commented Oct 9, 2017

Hi,

I ran into the same problem, but found the solution.
I think in your controller you should use this instead:

$scope.$on('colorpicker-closed', function(event, colorObject){
        console.log(event, colorObject);
   });

And colorpicker-closed="switchColor()" is unnecessary in your html code.

Cheers,

Levi

@Lulunx
Copy link
Author

Lulunx commented Oct 10, 2017

Hi,

Thanks for your help, it worked. I didn't know about .$on ( it was maybe my problem ! )

Lucas

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