第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

如何深度觀察angularjs中的數(shù)組?

如何深度觀察angularjs中的數(shù)組?

陪伴而非守候 2019-08-26 09:59:50
如何深度觀察angularjs中的數(shù)組?我的范圍中有一個對象數(shù)組,我想要觀察每個對象的所有值。這是我的代碼:function TodoCtrl($scope) {   $scope.columns = [       { field:'title', displayName: 'TITLE'},       { field: 'content', displayName: 'CONTENT' }   ];    $scope.$watch('columns', function(newVal) {        alert('columns changed');    });}但是當(dāng)我修改值時,例如我TITLE改為TITLE2,alert('columns changed')從不彈出。如何深入觀察數(shù)組內(nèi)的對象?有一個現(xiàn)場演示:http://jsfiddle.net/SYx9b/
查看完整描述

3 回答

?
拉風(fēng)的咖菲貓

TA貢獻1995條經(jīng)驗 獲得超2個贊

$scope.changePass = function(data){
    
    if(data.txtNewConfirmPassword !== data.txtNewPassword){
        $scope.confirmStatus = true;
    }else{
        $scope.confirmStatus = false;
    }};
  <form class="list" name="myForm">
      <label class="item item-input">        
        <input type="password" placeholder="???????????????????" ng-model="data.txtCurrentPassword" maxlength="5" required>
      </label>
      <label class="item item-input">
        <input type="password" placeholder="???????????????" ng-model="data.txtNewPassword" maxlength="5" ng-minlength="5" name="checknawPassword" ng-change="changePass(data)" required>
      </label>
      <label class="item item-input">
        <input type="password" placeholder="????????????????????????" ng-model="data.txtNewConfirmPassword" maxlength="5" ng-minlength="5" name="checkConfirmPassword" ng-change="changePass(data)" required>
      </label>      
       <div class="spacer" style="width: 300px; height: 5px;"></div> 
      <span style="color:red" ng-show="myForm.checknawPassword.$error.minlength || myForm.checkConfirmPassword.$error.minlength">??????????????????? 5 ????</span><br>
      <span ng-show="confirmStatus" style="color:red">?????????????????????</span>
      <br>
      <button class="button button-positive  button-block" ng-click="saveChangePass(data)" ng-disabled="myForm.$invalid || confirmStatus">???????</button>
    </form>


查看完整回答
反對 回復(fù) 2019-08-26
  • 3 回答
  • 0 關(guān)注
  • 603 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號