From f80d0d3d0644b4427cb6e2aedc172a839ac10f32 Mon Sep 17 00:00:00 2001 From: ukjadoon Date: Tue, 1 Apr 2014 14:02:43 +0200 Subject: [PATCH] Renamed render method to avoid conflict The previous pull request was missing a call to the new renderUI method. This one should fix it. Post Angular 1.2, the render method defined in select2.js clashes with Angular's native render method, thus, breaking the tagging functionality. By renaming the method, this problem is averted. --- src/select2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/select2.js b/src/select2.js index 828032d..ae81be4 100644 --- a/src/select2.js +++ b/src/select2.js @@ -91,7 +91,7 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec } controller.$render(); }, true); - controller.$render = function () { + controller.$renderUI = function () { if (isSelect) { elm.select2('val', controller.$viewValue); } else { @@ -202,7 +202,7 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec // Set initial value - I'm not sure about this but it seems to need to be there elm.select2('data', controller.$modelValue); // important! - controller.$render(); + controller.$renderUI(); // Not sure if I should just check for !isSelect OR if I should check for 'tags' key if (!opts.initSelection && !isSelect) {