diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbcheckbox.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbcheckbox.directive.js index f8643ad191..274d6e1241 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbcheckbox.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbcheckbox.directive.js @@ -36,17 +36,17 @@ (function () { 'use strict'; - function UmbCheckboxController($timeout) { var vm = this; - if (vm.onChange) { - $timeout(function() { - vm.onChange({model:vm.model, value:vm.value}); + vm.change = change; + + function change() { + $timeout(function () { + vm.onChange({ model: vm.model, value: vm.value }); }, 0); } - } var component = { diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbradiobutton.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbradiobutton.directive.js index 933107527b..59c3c3c35d 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbradiobutton.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbradiobutton.directive.js @@ -38,12 +38,13 @@ var vm = this; - if (vm.onChange) { + vm.change = change; + + function change() { $timeout(function () { vm.onChange({ model: vm.model, value: vm.value }); }, 0); - } - + } } var component = { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/forms/umb-checkbox.html b/src/Umbraco.Web.UI.Client/src/views/components/forms/umb-checkbox.html index 2f90905c7d..fd3b451e90 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/forms/umb-checkbox.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/forms/umb-checkbox.html @@ -8,7 +8,7 @@ ng-model="vm.model" ng-disabled="vm.disabled" ng-required="vm.required" - ng-change="vm.onChange()"/> + ng-change="vm.change()"/>