mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-29 13:25:40 +08:00
refact(select): use prop to modify the select property
jQuery suggests using `prop` rather than `attr` to modify the `select` property of an element. You can see the full list of migration warnings for jQuery: https://github.com/jquery/jquery-migrate/blob/master/warnings.md Closes #4107 Closes #4122
This commit is contained in:
committed by
Peter Bacon Darwin
parent
20c3c9e25f
commit
d7bfda61bf
@@ -553,7 +553,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|||||||
// rather then the element.
|
// rather then the element.
|
||||||
(element = optionTemplate.clone())
|
(element = optionTemplate.clone())
|
||||||
.val(option.id)
|
.val(option.id)
|
||||||
.attr('selected', option.selected)
|
.prop('selected', option.selected)
|
||||||
.text(option.label);
|
.text(option.label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user