JSColor Pick Up Color To Trigger AngularJS Ng-change
I use this plugin, JSColor (http://jscolor.com/) and bind the input value with AngularJS ng-model like the following:
$scope.alert = function(myColor) {
alert(myColor);
}
Or with injecting the $window service:
.controller('ctrl', function($scope, $window) {
$scope.alert = function(color) {
$window.alert(color);
}
})
Solution 2:
Your on-change is not fired because of the alert called. ng-change="alert(myColor)"
$scope.alert = function(myColor) {
alert(myColor);
}
Post a Comment for "JSColor Pick Up Color To Trigger AngularJS Ng-change"