Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Fix for #1165 and #1200 ( allow options tag outside of a select tag ). #1203

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/ng/directive/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ var optionDirective = ['$interpolate', function($interpolate) {
return {
restrict: 'E',
priority: 100,
require: '^select',
require: '?select',
compile: function(element, attr) {
if (isUndefined(attr.value)) {
var interpolateFn = $interpolate(element.text(), true);
Expand All @@ -531,12 +531,14 @@ var optionDirective = ['$interpolate', function($interpolate) {
}

return function (scope, element, attr, selectCtrl) {
if(!selectCtrl)
{
selectCtrl = nullSelectCtrl;
}
if (selectCtrl.databound) {
// For some reason Opera defaults to true and if not overridden this messes up the repeater.
// We don't want the view to drive the initialization of the model anyway.
element.prop('selected', false);
} else {
selectCtrl = nullSelectCtrl;
}

if (interpolateFn) {
Expand Down