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

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -