]> git.somenet.org - pub/jan/aic18.git/blob - sentiment-analysis/src/main/webapp/forms/input-terms.html
use rest api for forms
[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: 'Object',
16         value: terms,
17         valueInfo: {
18           // indicate that object is serialized as json
19           serializationDataFormat: 'application/json',
20           // provide classname of java object
21           objectTypeName: 'at.ac.tuwien.infosys.aic.serialized.model.Terms'
22         }
23       });
24
25     });
26
27   </script>
28
29   <h3>Terms</h3>
30
31   <div>
32     <div ng-repeat="term in terms">
33       <div class="control-group">
34         <div class="controls">
35           <input id="name"
36                  class="form-control"
37                  type="text"
38                  required
39                  ng-model="term">
40         </div>
41       </div>
42       <a href
43          ng-click="addTerm()"
44          class="btn btn-default">Add</a>
45     </div>
46   </div>
47 </form>