The ngTagsInput library does not have an option to disable removing tags via the 'Backspace' key.
Adding a normal keydown event will not suffice, because you need to intercept the existing event not add a new one, so any attempt to event.preventDefault() will not work.
Any ideas how to disable it?
The solution I came up with is to short circuit the
on-tag-removingfunction like so:NOTE Do yourself a favor and check your version of ngTagsInput matches the current version of the online docs as the
on-tag-removingfunction has changed to handle async/promises differently. This example works using the current newest version.NOTE If you want other instances of the ngTagsInput to allow the deleting, you might have to more accurately scope the querySelector!