I am working on a project where I have a color selector input. My goal is to set the background-color of an element to the value of this input when the page loads, and also whenever the input value changes. Can someone guide me on how to achieve this using AngularJS? So far, I have been able to set it on load using ng-style, but unfortunately, it does not update when the value changes.
<input type="text" ng-style="setColour(colour)" class="pickerInput" ng-model="colour" />
Additionally:
$scope.setColour = function (colour) {
return { 'background-color': colour };
};