diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Scope.js | 2 | ||||
| -rw-r--r-- | src/widgets.js | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/Scope.js b/src/Scope.js index 687d3628..7bcf7380 100644 --- a/src/Scope.js +++ b/src/Scope.js @@ -97,7 +97,7 @@ function createScope(parent, services, existing) { $set: bind(instance, setter, instance), $eval: function $eval(exp) { - if (exp) { + if (exp !== undefined) { return expressionCompile(exp).apply(instance, slice.call(arguments, 1, arguments.length)); } else { foreach(evalLists.sorted, function(list) { diff --git a/src/widgets.js b/src/widgets.js index 4eae735f..7de4bdc1 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -155,9 +155,15 @@ function initWidgetValue(initValue) { function radioInit(model, view, element) { var modelValue = model.get(), viewValue = view.get(), input = element[0]; + input.checked = false; input.name = this.$id + '@' + input.name; - if (isUndefined(modelValue)) model.set(null); - if (viewValue !== null) model.set(viewValue); + if (isUndefined(modelValue)) { + model.set(modelValue = null); + } + if (modelValue == null && viewValue !== null) { + model.set(viewValue); + } + view.set(modelValue); } function inputWidget(events, modelAccessor, viewAccessor, initFn) { |
