这是我的标签输入
<input type="hidden" ng-model="tags" class="input-large" ui-select2="{ tags: [{ id:5, text: 'tag1' }, { id: 8, text: 'tag2' }] }" />
现在我怎么做,比如标签id为5,预选加载?
如果我输入$scope。标签= [5];甚至$scope。Tags = 5它创建了一个新的标签,id为5,文本为5(虽然它从选项中删除)..我显然希望它说"tag1",而不是5,但仍然保持模型中的ID .
您演示的内容: