Closed parmindersingh1 closed 7 years ago
Same problem here, any fix for this @parmindersingh1?
Ok, I've fixed it, replace this code:
scope.$watch("value", function(newValue, oldValue) {
if ((newValue !== null || typeof newValue !== "undefined") && typeof oldValue !== "undefined" && newValue !== oldValue) {
knob.setValue(newValue);
}
});
With this patch:
var oldValue = scope.value;
scope.$watch("value", function(newValue) {
if ((newValue !== null || typeof newValue !== "undefined") && typeof oldValue !== "undefined" && newValue !== oldValue) {
knob.setValue(newValue);
oldValue = newValue;
}
});
On line 353 of ng-knob.js, then import ng-knob.js instead of the minified version.
I found out that by doing the following
scope.$watch("value", function(newValue, oldValue) { if ((newValue !== null || typeof newValue !== "undefined") && typeof oldValue !== "undefined" && newValue !== oldValue) { knob.setValue(newValue); drawKnob(); } });
you can fix this issue as well.
What is your opinion? Is it preferable?
Thanks @Nuxciel worked for me.
How can i import knob ???
I am trying to fetch value from server but its sometimes not updating knob
$scope.value= 0; $http.post(link).then(function (res){
$timeout(function() { $scope.value = res.value; },1000);
});