"use strict";

angular.module('arethusa.core').service('saver', [
  'configurator',
  'notifier',
  function(configurator, notifier) {
    var self = this;
    var persisters;

    function getPersisters() {
      var persisterConf = configurator.configurationFor('main').persisters;
      persisters = configurator.getPersisters(persisterConf);
    }

    function updateStatus() {
      if (persisters) {
        self.canSave = true;
      }
    }

    function reset() {
      self.canSave = false;
    }

    this.save = function() {
      angular.forEach(persisters, function(persister, name) {
        persister.saveData(function(data) {
          notifier.success('Document saved!');
        });
      });
    };

    this.init = function(newPersisters) {
      reset();
      getPersisters();
      updateStatus();
    };
  }
]);

@@ -338,32 +338,120 @@
 erConf);%0A    %7D%0A%0A
+    function hasPersisters(args) %7B%0A      return !angular.equals(%7B%7D, persisters);%0A    %7D%0A%0A
     function upd
@@ -474,17 +474,20 @@
     if (
-p
+hasP
 ersister
@@ -479,32 +479,34 @@
 f (hasPersisters
+()
 ) %7B%0A        self

Refactor saver