Explicitly set the form dirty when toggling a boolean

This commit is contained in:
Kenn Jacobsen
2019-01-29 16:49:10 +01:00
committed by Sebastiaan Janssen
parent 99f0e6c05a
commit 5637c44f69

View File

@@ -1,4 +1,4 @@
function booleanEditorController($scope) {
function booleanEditorController($scope, angularHelper) {
function setupViewModel() {
$scope.renderModel = {
@@ -28,7 +28,8 @@ function booleanEditorController($scope) {
};
// Update the value when the toggle is clicked
$scope.toggle = function(){
$scope.toggle = function () {
angularHelper.getCurrentForm($scope).$setDirty();
if($scope.renderModel.value){
$scope.model.value = "0";
setupViewModel();