From 1f3fafb998823a1425139c5539beddd143c4e4aa Mon Sep 17 00:00:00 2001 From: Mattia Corciulo Date: Tue, 11 Jul 2017 15:50:03 +0200 Subject: [PATCH] Handling of ngDisabled Added ngDisabled handling in both ngClass and ngClick attribute --- angular-ui-switch.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/angular-ui-switch.js b/angular-ui-switch.js index 9a6b591..364e764 100644 --- a/angular-ui-switch.js +++ b/angular-ui-switch.js @@ -6,11 +6,13 @@ angular.module('uiSwitch', []) , replace: true , transclude: true , template: function(element, attrs) { + var ngClickExpr = (attrs.ngDisabled ? attrs.ngDisabled : (attrs.disabled ? true : false)) + '? true : (' + attrs.ngModel + '=!' + attrs.ngModel + (attrs.ngChange ? '; ' + attrs.ngChange + '()' : '') + ')'; + var html = ''; html += '