This particular controller is functioning smoothly without any issues.
app.controller('foo', ['$scope',function ($scope) {
$scope.delete = function(){
bar($scope);
}
}]);
In an attempt to streamline it, I tried using bind
:
app.controller('foo', ['$scope',function ($scope) {
$scope.delete = bar.bind(null, $scope);
}]);
Regrettably, this approach does not produce the desired result and $scope
consistently retains an outdated version within the bound method (bar
in this case), even after it has been updated to a new value. What could be causing this issue?
Any other suggestions?
If using bind
is not recommended here, what alternative should be considered?