AngularJS : change directive scope from transclude -


How can I change the directional variable (which is in the director controller) from another controller, which is in another ?

If you want to change the variable across the controller, then you use the $ root scope instead of the dollar scope. Have to do. For example:

ABC is your variable.

Use this as:

  $ rootScope.abc = 1; (DirectX controller) // and change the value in the other controller $ rootScope.abc = 2; (Another controller)    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -