goog.provide('ngeo.DecorateInteraction');

goog.require('goog.asserts');
goog.require('ngeo');


/**
 * @typedef {function(ol.interaction.Interaction)}
 */
ngeo.DecorateInteraction;


/**
 * This service provides a function that adds an "active" property (using
 * `Object.defineProperty`) to the interaction, making it possible to
 * use ngModel to activate/deactivate interactions.
 *
 * Example:
 * <input type="checkbox" ngModel="interaction.active" />
 *
 * @param {ol.interaction.Interaction} interaction Interaction to decorate.
 */
ngeo.decorateInteraction = function(interaction) {
  goog.asserts.assertInstanceof(interaction, ol.interaction.Interaction);

  Object.defineProperty(interaction, 'active', {
    get: function() {
      return interaction.getActive();
    },
    set: function(val) {
      interaction.setActive(val);
    }
  });
};


ngeoModule.value('ngeoDecorateInteraction', ngeo.decorateInteraction);

@@ -1,209 +1,26 @@
-goog.provide('ngeo.DecorateInteraction');%0A%0Agoog.require('goog.asserts');%0Agoog.require('ngeo');%0A%0A%0A/**%0A * @typedef %7Bfunction(ol.interaction.Interaction)%7D%0A */%0Angeo.DecorateInteraction;%0A%0A%0A/**%0A * This service p
+/**%0A * @fileoverview P
 rovi
@@ -107,11 +107,10 @@
  to 
-the
+an
  int
@@ -140,19 +140,16 @@
 sible to
-%0A *
  use ngM
@@ -152,16 +152,19 @@
  ngModel
+%0A *
  to acti
@@ -268,16 +268,206 @@
 e%22 /%3E%0A *
+/%0A%0Agoog.provide('ngeo.DecorateInteraction');%0A%0Agoog.require('goog.asserts');%0Agoog.require('ngeo');%0A%0A%0A/**%0A * @typedef %7Bfunction(ol.interaction.Interaction)%7D%0A */%0Angeo.DecorateInteraction;%0A%0A%0A/**
 %0A * @par

Add @fileoverview to decorateinteraction.js