Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: Cannot read property 'splice' of undefined- Angular 5

Tags:

angular5

I am trying to splice object from an array of list of object, passing an object index as the first argument splice(index, 1), but it results in the following error:

Cannot read property 'splice' of undefined.

like image 943
Vaibhav Gaikwad Avatar asked Jan 24 '26 23:01

Vaibhav Gaikwad


1 Answers

this.MypostList is somehow evaluated empty in your code. So splice could not be executed on the empty object. Please put the code where you tried to evaluate this.MypostList

like image 84
Rak2018 Avatar answered Jan 29 '26 20:01

Rak2018



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!