You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.
If you use use-strings="true" along with on-tag-added (or other callbacks), the $tag passed to the onTagAdded($tag) function is an object (e.g. {text: 'Tag Name'}) instead of just the tag name string. In addition to this, on the first tag add, the tagsInput model within the onTagAdded($tag) function call is an array of objects instead of an array of strings. On additional adds, the model in onTagAdded($tag) is the correct array of strings; however, it is missing the newly added tag.
One thing to note: If you put a $timeout in the onTagAdded($tag) function, the model is always correct after the $timeout.
The text was updated successfully, but these errors were encountered:
cgatesman
pushed a commit
to NorthPage/ngTagsInput
that referenced
this issue
Nov 27, 2018
Fixesmbenford#874
Several issues were found while debugging and fixing mbenford#874:
- Pass just tag name string to callback functions when using `use-strings="true"`
- Call callback functions in a `$timeout` to ensure model has been appropriately updated with just tag strings before the callback is called. The model is updated in a watcher so it is asynchronously updated
- Use `$watchCollection` for tags watcher
- Do not clobber tags container when adding/removing items
If you use
use-strings="true"
along withon-tag-added
(or other callbacks), the$tag
passed to theonTagAdded($tag)
function is an object (e.g.{text: 'Tag Name'}
) instead of just the tag name string. In addition to this, on the first tag add, the tagsInput model within theonTagAdded($tag)
function call is an array of objects instead of an array of strings. On additional adds, the model inonTagAdded($tag)
is the correct array of strings; however, it is missing the newly added tag.One thing to note: If you put a
$timeout
in theonTagAdded($tag)
function, the model is always correct after the$timeout
.The text was updated successfully, but these errors were encountered: