0

I have two variables:

First one:

 studentSearchCriteria1=   {"studentList1":"key":"firstName","match":$scope.firstName,  "value":$scope.studentSearchCriteria.studentfName},],"searchUserInformationKey": [ "",],"start": 0}

and the second:

 var studentSearchCriteria1 = {"studentList2":[{"key":"lastName","match":$scope.firstName,"value":$scope.studentSearchCriteria.studentlName},],"searchUserInformationKey":["",],"start": 0}

I want add content of one array to another and result should be:

{"studentList1": [{"key":"firstName","match":$scope.firstName,"value":$scope.studentSearchCriteria.studentfName},{"key":"lastName","match":$scope.firstName,"value":$scope.studentSearchCriteria.studentlName},],"searchUserInformationKey":["",],"start": 0}
2
  • please guide me for this addition of data into json object array using angularjs Commented Nov 25, 2016 at 20:54
  • Questions asking for homework help must include a summary of the work you've done so far to solve the problem, and a description of the difficulty you are having solving it. Give a Man a Fish, and You Feed Him for a Day. Teach a Man To Fish, and You Feed Him for a Lifetime.Start fishing first, then ask for help. Commented Nov 25, 2016 at 21:20

1 Answer 1

0

You can use javascript push method and angular copy method angulat.copy(json).

studentSearchCriteria1.studentList1.push(angular.copy(secondJson));
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks buddy i got it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.