From 1714cc853ab61d52856f3b2622b23de731065c42 Mon Sep 17 00:00:00 2001 From: Alexandru Mahu Date: Wed, 27 Nov 2013 14:17:52 +0200 Subject: [PATCH] Fixed #57 - now select2 initializes also for optgroup --- src/select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/select2.js b/src/select2.js index 8d44d10..173041a 100644 --- a/src/select2.js +++ b/src/select2.js @@ -22,7 +22,7 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec // Enable watching of the options dataset if in use if (tElm.is('select')) { - repeatOption = tElm.find('option[ng-repeat], option[data-ng-repeat]'); + repeatOption = tElm.find( 'optgroup[ng-repeat], optgroup[data-ng-repeat], option[ng-repeat], option[data-ng-repeat]'); if (repeatOption.length) { repeatAttr = repeatOption.attr('ng-repeat') || repeatOption.attr('data-ng-repeat');