comparison 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
comparison
equal deleted inserted replaced
2857:80a3b693b3f6 2858:cffde1e75b2d
148 } 148 }
149 } 149 }
150 }; 150 };
151 }]); 151 }]);
152 152
153 AngularInterface.controller("survey", ['$scope', '$element', '$window', function ($s, $e, $w) {
154 $s.addSurveyEntry = function () {
155 $s.survey.addOption();
156 };
157 $s.removeSurveyEntry = function (entry) {
158 var index = $s.survey.options.findIndex(function (a) {
159 return a == entry;
160 });
161 if (index === -1) {
162 throw ("Invalid Entry");
163 }
164 $s.survey.options.splice(index, 1);
165 };
166 }]);
167
153 AngularInterface.controller("surveyOption", ['$scope', '$element', '$window', function ($s, $e, $w) { 168 AngularInterface.controller("surveyOption", ['$scope', '$element', '$window', function ($s, $e, $w) {
154 169
155 $s.removeOption = function (option) { 170 $s.removeOption = function (option) {
156 var index = $s.opt.options.findIndex(function (a) { 171 var index = $s.opt.options.findIndex(function (a) {
157 return a == option; 172 return a == option;