angular.scope.$bind
Description
Binds a function fn
to the current scope. See: angular.bind
.
var scope = angular.scope();
var fn = scope.$bind(function(){
return this;
});
expect(fn()).toEqual(scope);
Usage
angular.scope.$bind(fn);
Parameters
- fn –
{function()}
– Function to be bound.