Skip to content Skip to sidebar Skip to footer

Angularjs Remove A Child Object From Json Object

When i try to remove Child object i am getting an error TypeError: ctrl.otsact.tests.splice is not a function HTML :
ctrl.otsact.tests.splice(index, 1);

to this:

delete ctrl.otsact.tests[index];

Solution 2:

In your JSON representation, ctrl.otsact.ACT.tests is not an array. If you can change the JSON so that "tests" is an array then splice will work.

Post a Comment for "Angularjs Remove A Child Object From Json Object"