MCPcopy
hub / github.com/angular-ui/ui-router / bind

Function bind

test/angular/1.2/angular.js:1069–1087  ·  view source on GitHub ↗
(self, fn)

Source from the content-addressed store, hash-verified

1067 */
1068/* jshint +W101 */
1069function bind(self, fn) {
1070 var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
1071 if (isFunction(fn) && !(fn instanceof RegExp)) {
1072 return curryArgs.length
1073 ? function() {
1074 return arguments.length
1075 ? fn.apply(self, curryArgs.concat(slice.call(arguments, 0)))
1076 : fn.apply(self, curryArgs);
1077 }
1078 : function() {
1079 return arguments.length
1080 ? fn.apply(self, arguments)
1081 : fn.call(self);
1082 };
1083 } else {
1084 // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
1085 return fn;
1086 }
1087}
1088
1089
1090function toJsonReplacer(key, value) {

Callers 2

getterFunction · 0.70
$RootScopeProviderFunction · 0.70

Calls 2

sliceArgsFunction · 0.70
isFunctionFunction · 0.70

Tested by

no test coverage detected