From 6053cbd417d7a081f5a02275a615eddfad333f18 Mon Sep 17 00:00:00 2001 From: Andre Deutmeyer Date: Wed, 29 Apr 2015 22:31:58 -0700 Subject: [PATCH] fix(ngOptions): correctly watch displayed value for changes ngOptions does not update the displayed value properly if the property being used as the label changes when not using the "select as" or "track by" syntax. The bug is demonstrated here: [https://jsfiddle.net/76qrsctv/17/](https://jsfiddle.net/76qrsctv/18/) The proposed change fixes this issue. --- src/ng/directive/ngOptions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/directive/ngOptions.js b/src/ng/directive/ngOptions.js index 5f67c950e7e1..af6ad2cd716c 100644 --- a/src/ng/directive/ngOptions.js +++ b/src/ng/directive/ngOptions.js @@ -303,7 +303,7 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) { watchedArray.push(selectValue); // Only need to watch the displayFn if there is a specific label expression - if (match[2]) { + if (match[2] || match[1]) { var label = displayFn(scope, locals); watchedArray.push(label); }