From 8ba1f4d8938157a54d42ad6e36315e85d9a6ca6e Mon Sep 17 00:00:00 2001 From: Razvan Laurus Date: Fri, 21 Aug 2015 16:02:18 +0200 Subject: [PATCH] Add support for angular-1.4.x Update disabling functionality to work with or without ngDisabled Update angular dependency to "angular: ~1.4.0" in bower.json --- angular-toggle-switch.js | 5 ++++- bower.json | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/angular-toggle-switch.js b/angular-toggle-switch.js index eabf75a..564a491 100644 --- a/angular-toggle-switch.js +++ b/angular-toggle-switch.js @@ -22,7 +22,6 @@ replace: true, require:'ngModel', scope: { - disabled: '@', onLabel: '@', offLabel: '@', knobLabel: '@' @@ -55,6 +54,10 @@ } }); + attrs.$observe('disabled', function(val){ + scope.disabled = val; + }); + ngModelCtrl.$formatters.push(function(modelValue){ return modelValue; }); diff --git a/bower.json b/bower.json index 7f2cbd6..829fb76 100644 --- a/bower.json +++ b/bower.json @@ -11,8 +11,8 @@ "url": "https://github.com/cgarvis/angular-toggle-switch.git" }, "devDependencies": { - "angular": ">=1.0", - "angular-mocks": ">=1.0" + "angular": "~1.4.0", + "angular-mocks": "~1.4.0" }, "ignore": [ "**/.*", @@ -20,5 +20,8 @@ "karma.conf.js", "package.json", ".travis.yml" - ] + ], + "resolutions": { + "angular": "~1.4.0" + } }