-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
43 lines (40 loc) · 2.29 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html ng-app="introApp">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.2/angular.min.js"></script>
</head>
<body>
<div class="container">
<form name="surveyForm" ng-controller="IndexCtrl" novalidate>
<h1>{{ name }}</h1>
<div class="alert alert-success" ng-show="success">
<strong>Sie haben abgestimmt!</strong>
</div>
<div class="alert alert-danger" ng-show="error">
<strong>Sie haben nichts ausgewählt!</strong>
</div>
<div ng-switch on="type">
<div ng-switch-when="single" ng-repeat="option in options" class="well">
<input type="radio" ng-model="form.option" ng-value="option._id" ng-required="error"> {{ option.name }}
</div>
<div ng-switch-when="multi" ng-repeat="option in options track by $index" class="well">
<input type="checkbox" ng-model="form.options[$index]" ng-value="option._id" ng-required="error"> {{ option.name }}
</div>
<div ng-switch-when="number" class="well">
<input type="number" ng-model="form.option" ng-required="error">
</div>
<div ng-switch-when="text" class="well" ng-controller="InputCtrl">
<div ng-repeat="answer in form.options track by $index">
<input type="text" ng-value="answer" ng-model="form.options[$index]" ng-required="error">
<button ng-click="remove($index)" ng-show="form.options.length>1">-</button>
</div>
<button ng-click="add()" ng-show="form.options.length<max_answers">+</button>
</div>
</div>
<input type="submit" value="Abschicken" ng-click="vote(form)">
</form>
</div>
<script src="scripts.js"></script>
</body>
</html>