Mindaugas Mindaugas - 1 year ago 119
AngularJS Question

Does Angular JS have an equivalent of dojo.hitch()

Forgive my ignorance as I am not as familiar with Angular js. Is there an equivalent to dojo.hitch()? It returns a function that is guaranteed to be executed in the given scope.

Answer Source

You can actually use the native JavaScript bind.

var boundFunction = lang.hitch(this, myFunction);

is the same as

var boundFunction = myFunction.bind(this);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download