javascript - Angular-ui tagging convert array to string -
i using ui-select directive in template, bound on object has property set string. since ui-select
save values array
in property, possible transform value automatically in model when save value string? tried ng-value="model.property.join(',')"
has no effects.
the complete code of element:
<ui-select multiple tagging tagging-label="false" theme="bootstrap" ng-model="user" ng-value="user.keywords.join(',')"> <ui-select-match placeholder="keywords">{{$item}}</ui-select-match> <ui-select-choices repeat="keyword in user.keywords | filter:$select.search">{{keyword}}</ui-select-choices> <ui-select>
and when save object sends keywords as: ["keyword", "other"]
Comments
Post a Comment