]> git.somenet.org - pub/jan/aic18.git/blob - sentiment-analysis/src/main/webapp/forms/input-terms.html
cleaner form
[pub/jan/aic18.git] / sentiment-analysis / src / main / webapp / forms / input-terms.html
1 <form name="twitterForm" role="form">
2   <script cam-script type="text/form-script">
3     // angular form works on scope object
4     var terms = $scope.terms = [];
5
6     // scope function which adds a new term
7     $scope.addTerm = function() {
8       terms.push({});
9     };
10
11     camForm.on('form-loaded', function() {
12       // declare variable 'terms' incuding metadata for serialization
13       camForm.variableManager.createVariable({
14         name: 'terms',
15         type: 'json',
16         value: terms
17       });
18
19     });
20
21   </script>
22
23   <h3>Terms</h3>
24
25   <div ng-repeat="term in terms">
26     <div class="control-group">
27       <div class="controls">
28         <input id="term"
29                class="form-control"
30                type="text"
31                required>
32       </div>
33     </div>
34   </div>
35   <a href
36      ng-click="addTerm()"
37      class="btn btn-default">Add</a>
38   <hr/>
39 </form>