I have a json array with objects. Each object has bunch of key and values. Using ng-repeat to shown the object's in my html page. If i click edit for the particular object, an object will toggle on bootstrap modal. If changes made in the modal window, its directly affects the json object and instant changes should occur in UI. so i using a angular.copy to take an duplicate object and shown in the modal window. I want to do, if i click update button means within the modal dialog, splice the json object and insert the duplicated json object into the array within the same index. How can i do it. Here sample code
$scope.array = [{"ItemId":"20113",
"ItemModel":"C2",
"ItemName":"Nokia", .....},
{....},
{....},
{....}, ......]
I want splice index 2 in the array and insert an new object in the array as the same index of 2