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
How can i pass extra parameter when color changed? #190
Comments
@jaydeeptops See this example html and javascript for how to use the event api. Let me know if that helps you or not. |
@ruhley In my project, I have 3 buttons of the color picker. As per event, I am getting which color selected in the onchange event but i need something to pass in the event api that which button type clicked. Like i have 3 buttons A, B, C. When color changed for A button then I want to pass type A in the onchange event. Can you please provide me a solution how can I pass it? Thanks |
@jaydeeptops I think you would have to create separate event apis and do something like this $scope.onChange = function (color, type) {
console.log(color, type);
};
$scope.eventApiA = {
onChange: function(color) {
$scope.onChange(color, 'A');
}
};
$scope.eventApiB = {
onChange: function(color) {
$scope.onChange(color, 'B');
}
};
$scope.eventApiC = {
onChange: function(color) {
$scope.onChange(color, 'C');
}
}; Let me know if that solves it for you. |
@ruhley Thanks for the solution. But is there any other solution to pass parameters in the function? |
@jaydeeptops Unfortunately not. |
@ruhley Thanks for the reply. I have implemented as you suggested. |
In the click event of the other button you should be able to get the value from |
Hello
I want to pass some addition parameter like this when the color changed?
<color-picker` ng-model="account_type.type_color" options="options" event-api="eventApi(extraParameter)">
Can you please help me solve this issue?
Thanks
The text was updated successfully, but these errors were encountered: