Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular.bind vs ECMAScript 5 .bind

Is there any advantage to using angular.bind instead of ECMAScript 5's Function.prototype.bind?

Is it just a shim to support older browsers or is there some advantage?

like image 446
wmil Avatar asked Mar 23 '23 04:03

wmil


1 Answers

Yes, it is essentially a shim with some typechecking. Function.prototype.bind is an ES5 construct, so you are looking at IE9+, FF4+, etc.

Here is the code

like image 91
Wyatt Avatar answered Apr 02 '23 10:04

Wyatt