I have a jquery colorPicker component. in myApp.js, I use that snippet:
myApp.controller('chatController', function ($scope) {
$scope.texts = [];
$scope.color = "#00FF00";
$scope.test = "before";
$('button#color').simpleColorPicker({ onChangeColor: function(color) {
console.log(color);
$scope.color = "#FF0000";
$scope.test = "after";
} });
I have a {{color}} and {{test}} in my view.
Problem is: when colorPicker triggers changed, this is not reflected ! Instead I need to refresh some other data bindings and then {{test}} and {{color}} change.
What is wrong ?
$scope.apply(function(){$scope.color = "#FF0000"; $scope.test = "after";})inside onchange color