0
我有一個創建具有標籤的物體的角形式:引導tagsinput具有角NG-模型問題
<form class="form-horizontal">
<div class="form-group">
<label>Tags</label>
<input type="text" id="tags-input" class="form-control" ng-model="beaconData.tag_list" name="beacon[tag_list]" placeholder="project, client 72, yellow, design"/>
</div>
「#tagsinput」被調用tagsinput功能在這裏看到的ID:
$('#tags-input').tagsinput('items');
使用調用此函數的標識,ng-model =「beaconData.tag_list」返回undefined。如果tagsinput函數沒有被調用,那麼ng-model返回沒有問題的數據。
有沒有人可能會有答案,爲什麼會發生這種情況?
更好的問題可能是tagsinput函數對輸入值有什麼作用,爲什麼它不返回到ng-model?
當你沒有這個jQuery代碼模型是充滿數據? –
正確,這jQuery代碼確實格式化輸入字段中的標籤雖然 – Bruce1138
你能分享更多的js代碼嗎?因爲這一行似乎沒有連接到該beaconData。 –