add forms
[pub/jan/aic18.git] / sentiment-analysis / src / main / webapp / forms / input-terms.html
index ffbd7b56fdbc5210887f036f3753c293dca57b4e..3c9e6c8ea01d9a25df9067386ef71c320e9893bd 100644 (file)
@@ -5,7 +5,7 @@
 
     // scope function which adds a new term
     $scope.addTerm = function() {
-      terms.push({});
+         terms.push({});
     };
 
     camForm.on('form-loaded', function() {
         type: 'json',
         value: terms
       });
-
     });
 
+    camForm.on('submit', function() {
+      // remove '$$hashKey' properties
+      angular.forEach($scope.terms, function(term) {
+        delete term.$$hashKey;
+      });
+       });
+
   </script>
 
   <h3>Terms</h3>
@@ -28,7 +34,8 @@
         <input id="term"
                class="form-control"
                type="text"
-               required>
+               required
+                          ng-model="term.term">
       </div>
     </div>
   </div>