I was told if you need to share between controllers you should use a service. I have controller A, which is a list of news websites, and controller B which is a list of articles on the sites from controller A. Controller B contains the list of articles and an iframe to display the articles. But when you click on controller A it should fade out the iframe and fade in the list. In order to accomplish this I give Controller B's scope to a service that is injected into both controller A and controller B. My question is whether or not it's okay to do that.

Basically, I do this:

```
app.factory("sharedService", function () {
    var $scope = null;
    return {
        SetScope: function (scope) {
            $scope = scope;
        },
        ControllerB_Action: function () {
            $scope.doSomething();
        }
    };
});
app.controller("controllerA", ["$scope", "sharedService", function ($scope, sharedService) {
    $scope.onaction = function () {
        sharedService.ControllerB_Action();
    }
}]);
app.controller("controllerB", ["$scope", "sharedService", function ($scope, sharedService) {
    sharedService.SetScope($scope);
}]);

```