I can't figure out, how events work with Angular Bootstrap Colorpicker. Here is a Plunker I forked from the developer example. Sadly, the developer made no example for using events.
Events like colorpicker-selected, colorpicker-selected-saturation, colorpicker-selected-hue, colorpicker-selected-alpha, colorpicker-shown, colorpicker-closed should be supported. Just one example would be nice.
Base code without any events:
'use strict';
angular.module('colorApp', ['colorpicker.module'])
.controller('MainCtrl', ['$scope', function($scope) {
$scope.nonInput = {
color: ''
};
$scope.resetNonInputColor = function() {
$scope.nonInput = {
color: '#ffffff'
};
};
}]);
$scope.$on('colorpicker-shown', function(){ /* Your code goes here */ });would work. (However, anngModelhas to be set up on the directive before it fires: github.com/buberdds/angular-bootstrap-colorpicker/blob/master/… )$rootScopebehavior. Please post this as answer, ill mark it as right. Thx m8. This plugin seems not to be compatible with angularJS directives. Its a kind of "random" handling.