I have changed little bit in the structure of questions
$scope.subject .questions.push($scope.subject .questions.description=$scope.questionList[i].id,$scope.subject .questions.questionId=$scope.questionId); Is this the correct way of doing it ?
Rob Spoor wrote:Your $scope.subject.questions array contains objects. That means you need to add them as objects:
Thanks it worked out for me ..
I am having an another question if I want to save this subject into my SQL database using java so what should be my approach ?
And one more question if I call add Question function multiple times in a single session so the data which I have inserted in the last call gets overwrite or it just adds further.
Rob Spoor wrote:Post it using an AJAX call to a back-end service, that will do the actual inserting. You can use a JSON or form-style request body.
I have thought of posting subject through http request post to my controller and then saving it in my DB in arraylist format while mapping questions field with another table. Is this a correct way of doing it?
priyanshi bhardwaj wrote:saving it in my DB in arraylist format
I'm not sure what you mean by that, but it doesn't sound like a good idea to me. I would suggest designing a properly normalized database for a start, and have the back end parse the data it receives and store that data in suitable tables.
priyanshi bhardwaj wrote:saving it in my DB in arraylist format
I'm not sure what you mean by that,
Array list I mean to say list of questions I'd would be stored in the table known as subjects and those questions id will be mapped in another table with description id .
expectation is the root of all heartache - shakespeare. tiny ad:
a bit of art, as a gift, the permaculture playing cards