as long as the interval which accesses *webkitGetUserMedia calls $rootScope.$apply() angular refresh watches when the service calculates the volume. You can then just reference the calculated value directly from the controllers, and when it changes, they will be updated, due to angulars databinding. *
*no?* On 6 April 2014 00:34, Yehonathan Sharvit <[email protected]> wrote: > I have a service that is connected to the microphone ( > *navigator.webkitGetUserMedia*) and calculates the microphone volume ~ > every 20 msec. > I would like to access the calculated volume from two controllers. > > The only solutions I found are: > 1. to use $interval from inside the controller. But it takes a lot of CPU > resources. > 2. to fire an event from the service and listen to the event from the two > controllers. > > > Any other suggestions? > > -- > You received this message because you are subscribed to the Google Groups > "AngularJS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- Tony Polinelli -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
