md-checkbox triggers ng-click even when it is disabled
Hello,
When md-checkbox is disabled but has an ng-click, the ng-click code gets called when the md-checkbox is clicked.
This is not the case with a normal input checkbox.
<md-checkbox ng-disabled="true" ng-click="update(!item)" aria-label="Disabled checkbox" ng-model="item">
md-checkbox: Disabled with ng-click
</md-checkbox>
<input type="checkbox" ng-disabled="true" ng-click="update(!item)" ng-model="item" />
Here is a test that shows the issue: http://plnkr.co/edit/t9XO0TGIA5u6m2dym1Fd?p=preview
Thanks in advance
Same here. Even we are facing the exactly same issue.
workaround - add a parent div around the checkbox and disable that http://plnkr.co/edit/nbwsJfe5xBkBGhgoTarE?p=preview
Thanks..
+1
+1
+1
I have this isssue when i create checkbox dynamically using ng-repeat
[(http://codepen.io/madhavansekar/pen/ZQVzLb)]
kindly suggest some ideas to overcome this issue
Cleanest approach: the ng-click should only execute a single method on the controller, which as its first action does the same check as the ng-disabled and returns immediately if so. Yes, you've duplicated some code, but your controller is no longer depending on the template to do its data sanitization.
+1