Skip to content

Commit 2663858

Browse files
committed
debug select
1 parent d3f9465 commit 2663858

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/directive/ng_model_select.dart

+2
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class _SingleSelectMode extends _SelectMode {
185185
print('onModelChange $value');
186186
bool found = false;
187187
_forEachOption((option, i) {
188+
print('value = ${option.value}, text = ${option.text}, selected = ${option.selected}');
188189
if (option == _unknownOption) return;
189190
var selected;
190191
if (value == null) {
@@ -193,6 +194,7 @@ class _SingleSelectMode extends _SelectMode {
193194
OptionValue optionValue = options[option];
194195
selected = optionValue == null ? false : optionValue.ngValue == value;
195196
}
197+
if (selected) print('-> SELECTED');
196198
found = found || selected;
197199
option.selected = selected;
198200
});

test/directive/ng_model_select_spec.dart

+6
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,14 @@ main() {
225225
'<option>r2d2</option>' +
226226
'</select>');
227227
_.rootScope.apply();
228+
229+
print('**** Select HTML:');
230+
print(_.rootElement.outerHtml);
231+
228232
expect(_.rootElement).toEqualSelect([['?'], 'c3p0', 'r2d2']);
229233

234+
return;
235+
230236
_.rootScope.apply(() {
231237
_.rootScope.context['robot'] = 'r2d2';
232238
});

0 commit comments

Comments
 (0)