添加以空格分隔的标记时,ng-tags-input将用破折号替换空格。我如何才能保留空格字符呢?
发布于 2015-06-10 02:38:03
我刚刚在文档中找到了相应的指令属性。答案:使用replace-spaces-with-dashes=false
发布于 2016-01-05 21:05:50
为了将空格替换为下划线,我执行了以下操作:
HTML:
<tags-input ng-model="model" replace-spaces-with-dashes="false" on-tag-adding="addingTag($tag)"></tags-input>JS:
$scope.addingTag = function(tag) {
tag.text = tag.text.replace(/ /g, '_');
return tag;
};https://stackoverflow.com/questions/30740139
复制相似问题