I want to remove an item from a stored array in angular 2, with Type Script. I am using a service called Data Service, the DataService Code:
export cl
Don't use delete to remove an item from array and use splice() instead.
this.data.splice(this.data.indexOf(msg), 1);
See a similar question: How do I remove a particular element from an array in JavaScript?
Note, that TypeScript is a superset of ES6 (arrays are the same in both TypeScript and JavaScript) so feel free to look for JavaScript solutions even when working with TypeScript.