[SEBA-136] Resetting default feedback config when xosForm is removed

Change-Id: I18641b05001fa6b55e7976ae85695c5865571933
diff --git a/src/app/core/form/form.ts b/src/app/core/form/form.ts
index 1c10c33..fa54c6f 100644
--- a/src/app/core/form/form.ts
+++ b/src/app/core/form/form.ts
@@ -72,19 +72,28 @@
 }
 
 class FormCtrl {
-  $inject = ['$onInit', '$scope', 'XosFormHelpers'];
+  $inject = ['$onInit', '$onDestroy', '$scope', 'XosFormHelpers', '$log'];
 
   public ngModel: any;
   public formField: any;
   private config: any;
 
+  private hideFeedback: IXosFeedback = {
+    show: false,
+    message: 'Form submitted successfully !!!',
+    type: 'success',
+    closeBtn: true
+  };
+
   constructor (
     private $scope: ng.IScope,
+    private $log: angular.ILogService,
     private XosFormHelpers: IXosFormHelpersService
   ) {
   }
 
   $onInit() {
+    this.$log.debug('[xosForm] Init component');
     if (!this.config) {
       throw new Error('[xosForm] Please provide a configuration via the "config" attribute');
     }
@@ -99,12 +108,7 @@
 
     // NOTE needed to avoid xosAlert throw an error
     if (!this.config.feedback) {
-      this.config.feedback =  {
-        show: false,
-        message: 'Form submitted successfully !!!',
-        type: 'success',
-        closeBtn: true
-      };
+      this.config.feedback =  this.hideFeedback;
     }
 
     // remove excluded inputs
@@ -112,6 +116,11 @@
       _.remove(this.config.inputs, i => this.config.exclude.indexOf(i.name) > -1);
     }
   }
+
+  $onDestroy() {
+    this.$log.debug('[xosForm] Destroying component');
+    this.config.feedback =  this.hideFeedback;
+  }
 }
 
 export const xosForm: angular.IComponentOptions = {