亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

angular ng-model 綁定的值不更新

angular ng-model 綁定的值不更新

夢里花落0921 2018-08-06 11:10:59
angular ng-model 綁定的值不更新代碼主要部分如下// html代碼<div class="form-group">   <label>Slot : </label>   <select class="form-control" ng-model="selectedSlot" ng-options="slot for slot in slotlist"></select> </div>//javascript代碼$scope.slotlist = ['Flash Ads', 'Native Ads', 'Lock Ads']; $scope.selectedSlot = $scope.slotlist[0];如代碼所示,為什么我改變下拉框的值時,$scope.selectedSlot 并沒有動態改變?是不是因為$scope.selectedSlot是數組的一個值,相當于常量?求詳細解答
查看完整描述

1 回答

?
慕桂英3389331

TA貢獻2036條經驗 獲得超8個贊

selectedSlot 換成對象格式:
selectedSlot.someAttr

查看完整回答
反對 回復 2018-09-20
  • 1 回答
  • 0 關注
  • 1592 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號