From e5611b7422c926b4af0fc518cbb51cee739e3745 Mon Sep 17 00:00:00 2001 From: Adam George Date: Wed, 27 Nov 2013 16:27:34 +1100 Subject: [PATCH] Fixes issue where there is no expression to interpolate, therfore was failing --- src/integration/option.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/integration/option.js b/src/integration/option.js index 349bae3..1a38124 100644 --- a/src/integration/option.js +++ b/src/integration/option.js @@ -10,12 +10,17 @@ valueInterpolateFn = $interpolate(tElement.attr('value'), true); } return function (scope, iElement, iAttrs) { - scope.$watch(textInterpolateFn, function () { - iElement.trigger("$childrenChanged"); - }); - scope.$watch(valueInterpolateFn, function () { - iElement.trigger("$childrenChanged"); - }); + if (textInterpolateFn != null) { + scope.$watch(textInterpolateFn, function () { + iElement.trigger("$childrenChanged"); + }); + } + + if (valueInterpolateFn != null) { + scope.$watch(valueInterpolateFn, function () { + iElement.trigger("$childrenChanged"); + }); + } }; } };