1 appDS2.controller('nbookController', ['$scope', '$location','$window','$http', function ($scope,$location,$window,$http) {
2 $scope.keyValueList = [{}];
3 $scope.submitParameters = function() {
4 $scope.iframevisibility = false;
6 $scope.additionalqueryParams = {};
7 //Use this if there is only one 1 query param key value pair
8 $scope.additionalqueryParams.paramKey = $scope.qparamKey;
9 $scope.additionalqueryParams.paramVal = $scope.qparamVal;
11 for(var i = 0; i < $scope.keyValueList.length; i++) {
12 var obj = $scope.keyValueList[i];
13 if (obj.qK != undefined && obj.qV != undefined) {
15 qryStr = qryStr+'&'+obj.qK+'='+obj.qV;
17 qryStr = obj.qK+'='+obj.qV;
20 var queryurl = 'nbooktest.htm?nid='+$scope.notebookvalue+'&'+qryStr;
21 window.open (queryurl,'_self',false);
23 $scope.addKeyValuePairs = function (kv) {
24 if ($scope.keyValueList.length < 9) {
25 $scope.keyValueList.push({
28 document.getElementById("addbtn")["disabled"] = true;
31 $scope.removeKeyValuePairs = function (index) {
32 $scope.keyValueList.splice(index, 1);
33 if ($scope.keyValueList.length == 8) {
34 document.getElementById("addbtn")["disabled"] = false;