Closed lihsai0 closed 3 years ago
When I click the switch which is disabled, the on-change function switchTimesPlus is run. This should not happen!
<switch name="status" ng-change="switchTimesPlus(1)" ng-model="switchStatus" disabled="disabledStatus"></switch> <button type="button" ng-click="disabledStatus = !disabledStatus">DisabledToggle</button> <button type="button" ng-click="switchStatus = !switchStatus">StatusToggle</button> <div>Status:{{switchStatus}}</div> <div>Disabled:{{disabledStatus}}</div> <div>SwitchTimes:{{switchTimes}}</div>
$scope.switchStatus = false; $scope.disabledStatus = false; $scope.switchTimes = 0; $scope.switchTimesPlus = function (i) { $scope.switchTimes += i; };
When I click the switch which is disabled, the on-change function switchTimesPlus is run. This should not happen!
html
controller