ruhley / angular-color-picker

Vanilla AngularJS Color Picker Directive with no requirement on jQuery
http://ruhley.github.io/angular-color-picker/
MIT License
165 stars 78 forks source link

color-picker not working in android webview #121

Closed shivenigma closed 8 years ago

shivenigma commented 8 years ago

Hi I am using this color picker with ionic and fabricJS,

<color-picker class="color-picker-dir" ng-model="vm.textColor" options="vm.colorOptions" event-api="vm.eventApi"></color-picker>

The above is the template code.

ref.colorOptions = {
            format : 'hex',
            alpha : false,
            pos : 'top left',
            swatch : false,
            swatchOnly : true,
        };
        ref.eventApi = {
            onchange : function(api, color, $event) {
                console.log('test-vent', color);
            },
            onBlur : function (api, color, $event) {},
            onOpen : function (api, color, $event) {},
            onClose : function (api, color, $event) {},
            onClear : function (api, color, $event) {},
            onReset : function (api, color, $event) {},
            onDestroy : function (api, color) {},
        };

the above is the settings from the controller, the color picker is displaying fine but the on change never getting called. I tried setting up a watch on the model value it's not working either. Please help me what could be wrong?

ruhley commented 8 years ago

Hi @shivenigma,

I have no experience with ionic or fabricjs, so I cannot help you there. However looking at your code the name of the function should use camel case onChange

shivenigma commented 8 years ago

@ruhley I was on a deadline so switched to another color picker, when I get time I'll test this color picker through and report you what I found. Thanks for your response. I close this issue for now.