i need to following code to access service instance variable inside the $rootscope.
myapp.service('myservice',function($rootScope)
{
this.var = false;
$rootScope.$on('channel',function(e,msg)
{
var = true;
});
});
how can i access myservice.var inside the $rootscope.$on?.