Answers for "angular delete from array by name"

2

angular delete from array by name

this.data = this.data.filter(item => item !== data_item);
Posted by: Guest on May-25-2020
2

angular delete from array by name

deleteMsg(msg:string) {
    const index: number = this.data.indexOf(msg);
    if (index !== -1) {
        this.data.splice(index, 1);
    }        
}
Posted by: Guest on May-25-2020

Code answers related to "angular delete from array by name"

Code answers related to "Javascript"

Browse Popular Code Answers by Language