diff test_create/test_core.js @ 2858:cffde1e75b2d

Test create: Completed setup node
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Thu, 27 Apr 2017 11:43:08 +0100
parents 80a3b693b3f6
children d432bf25889b
line wrap: on
line diff
--- a/test_create/test_core.js	Thu Apr 27 11:24:16 2017 +0100
+++ b/test_create/test_core.js	Thu Apr 27 11:43:08 2017 +0100
@@ -150,6 +150,21 @@
     };
 }]);
 
+AngularInterface.controller("survey", ['$scope', '$element', '$window', function ($s, $e, $w) {
+    $s.addSurveyEntry = function () {
+        $s.survey.addOption();
+    };
+    $s.removeSurveyEntry = function (entry) {
+        var index = $s.survey.options.findIndex(function (a) {
+            return a == entry;
+        });
+        if (index === -1) {
+            throw ("Invalid Entry");
+        }
+        $s.survey.options.splice(index, 1);
+    };
+}]);
+
 AngularInterface.controller("surveyOption", ['$scope', '$element', '$window', function ($s, $e, $w) {
 
     $s.removeOption = function (option) {