ensure fallback value is defined on value updates

This commit is contained in:
Niels Lyngsø
2020-10-05 11:02:07 +02:00
parent 978d245f00
commit 3a06195e3d

View File

@@ -171,7 +171,7 @@ Use this directive to render an umbraco button. The directive can be used to gen
vm.innerState = changes.state.currentValue;
}
if (changes.state.currentValue === 'success' || changes.state.currentValue === 'error') {
// set the state back to 'init' after a success or error
// set the state back to 'init' after a success or error
$timeout(function () {
vm.innerState = 'init';
}, 2000);
@@ -196,6 +196,13 @@ Use this directive to render an umbraco button. The directive can be used to gen
setButtonLabel();
}
// watch for type changes
if(changes.type) {
if (!vm.type) {
vm.type = "button";// set the default
}
}
}
function clickButton(event) {