From 9767f7bdd3e1ce6f65bdea992d67369ead13d813 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 10 Aug 2012 15:38:05 -0700 Subject: fix(option): support option elements in datalist previously we expected to find option elements only within select element and if that was not the case we throw an error. This made it impossible to include datalist element with nested option elements in the template. Closes #1165 --- test/ng/directive/selectSpec.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ng/directive/selectSpec.js b/test/ng/directive/selectSpec.js index 321990e8..c63d17bf 100644 --- a/test/ng/directive/selectSpec.js +++ b/test/ng/directive/selectSpec.js @@ -1108,7 +1108,7 @@ describe('select', function() { }); - describe('OPTION value', function() { + describe('option', function() { it('should populate value attribute on OPTION', function() { compile(''); @@ -1125,5 +1125,18 @@ describe('select', function() { compile(''); expect(element).toEqualSelect(['hello']); }); + + it('should not blow up when option directive is found inside of a datalist', + inject(function($compile, $rootScope) { + var element = $compile('
' + + '' + + '{{foo}}' + + '
')($rootScope); + + $rootScope.foo = 'success'; + $rootScope.$digest(); + expect(element.find('span').text()).toBe('success'); + dealoc(element); + })); }); }); -- cgit v1.2.3