mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 03:30:02 +08:00
fixed issue with radio view clobering model if radio was checked.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user