title: Reuse functions with $scope acces Angular
body: <p>I'am sloving problem of reusing same function with scope access in two Controllers
  decribed here:
  <a href="https://stackoverflow.com/questions/19642138/how-to-include-inject-functions-which-use-scope-into-a-controller-in-angularjs">How to include/inject functions which use $scope into a controller in angularjs?</a></p>
  
  <p>In controller:</p>
  
  <pre><code>new CommonService($scope).getSomethingFromDB();
  </code></pre>
  
  <p>In factory:</p>
  
  <pre><code>services.factory("CommonService", function (DBService) {
  
  function Factory ($scope) {
  
      this.$scope = $scope;
  }
  
  Factory.prototype.getSomethingFromDB = function () {
      if( angular.isUndefined(this.$scope.vrsteObracuna) || this.$scope.vrsteObracuna === null) {
  
          this.$scope.loading = true;
          DBService.getSomethingFromDB(
              function success(data) {
                  this.$scope.loading = false; //ERROR !!!
                  this.$scope.vrsteObracuna = data;
              },
              function error(data, status, headers, config) {
                  this.$scope.loading = false;
                  etna.notifications.error("Error fetching!");
              }
          )
      }
  
      return this.$scope.vrsteObracuna;
  }
  
  return Factory;
  });
  </code></pre>
  
  <p>Problem is that after success callback from DBService.getSomethingFromDB
  this.$scope.loading is undefined ? </p>