@RutwickGangurde and others who have problems, if you try to set a scope variable that is not an object, it will not work. I assume what you are doing in your service now:
... this.myVar = true; ...
and then try to install it in the directive / controller:
... scope.myVar = myService.myVar; ...
This will NOT work to get the updated variable in the service when it changes.
Try this in your service:
... this.myObj = {}; this.myObj.myVar = true; ...
and in your directive / controller:
... scope.myValue = myService.myObj; ...
and in your html:
... {{ myValue.myVar }} ...
I would do it as a comment, but I do not have sufficient privileges, but I decided to publish it as an answer with a very brief example.
source share