What is the difference between the following codes
function Ctrl($scope) {
$scope.$watch(function() {
return this.variable;
}.bind(this), /*...*/);
}
and
function Ctrl($scope) {
$scope.$watch(angular.bind(this, function() {
return this.variable;
}, /*...*/);
}
for me are the same but is there any advantage of using angular.bind?