Angular, update value from javascript [closed]

1

I have been working on angular and today I have the need to modify a scope value from a javascript function, however I have not found an efficient way to do it from outside the controler, Does anyone know how it could be done?

    
asked by Oscar Alonso Rueda Ruiz 09.02.2017 в 20:43
source

1 answer

1

If you need to be modifying a variable globally (different controllers) stop using $scope since its scope is in a single controller. I recommend you use $rootScope since the scope of the variables declared here is greater and you can access them from any controller.

You will have to inject in all controls $rootScope .

    
answered by 09.02.2017 / 21:02
source