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
You can't use delete to remove an item from an array. This is only used to remove a property from an object.
delete
You should use splice to remove an element from an array:
deleteMsg(msg:string) { const index: number = this.data.indexOf(msg); if (index !== -1) { this.data.splice(index, 1); } }