Is possible that I can preserve the original binded ng-model's data format?
For example, when my original model is:
["tag1", "tag2", "tag3"]
After ng-tag-input's process my model is:
[{"text": "tag1"}, {"text": " tag2"}, {"text": " tag3"}]
I need a way to prevent ng-tag-imput change the format of my model.
Thanks a lot!
ngTagsInput only works with arrays of objects. It will automatically convert an array of strings into an array of objects for convenience.
To convert an array of objects back into an array of strings, you can do the following:
$scope.tagsString = $scope.tags.map(function(tag) { return tag.text; });