angularjs - How to do intheContextof in javascript so that scope could be changed -
b/c i'm using angular js, have parsing headaches looking @ $rootscope.something
is possible
function inthecontextof(obj, func){ func.call(obj); }
where
inthecontextof($rootscope, function(){ flamingo = 5 //$rootscope.flamingo im refering $apply() }
you'd have write this:
inthecontextof($rootscope, function(){ this.flamingo = 5 //$rootscope.flamingo im refering $apply() }
now i'm not sure expect "$apply" here; if it's going implicitly reference "$rootscope" should ok.
Comments
Post a Comment