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

Function bind

test/angular/1.4/angular.js:1208–1226  ·  view source on GitHub ↗
(self, fn)

Source from the content-addressed store, hash-verified

1206 */
1207/* jshint +W101 */
1208function bind(self, fn) {
1209 var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
1210 if (isFunction(fn) && !(fn instanceof RegExp)) {
1211 return curryArgs.length
1212 ? function() {
1213 return arguments.length
1214 ? fn.apply(self, concat(curryArgs, arguments, 0))
1215 : fn.apply(self, curryArgs);
1216 }
1217 : function() {
1218 return arguments.length
1219 ? fn.apply(self, arguments)
1220 : fn.call(self);
1221 };
1222 } else {
1223 // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
1224 return fn;
1225 }
1226}
1227
1228
1229function toJsonReplacer(key, value) {

Callers 1

getterFunction · 0.70

Calls 3

sliceArgsFunction · 0.70
isFunctionFunction · 0.70
concatFunction · 0.70

Tested by

no test coverage detected