From 34b68ef5e84155ca4a7f3bcc7e375e447ad3a2a2 Mon Sep 17 00:00:00 2001 From: Jeff Cross Date: Tue, 21 Oct 2014 05:40:43 +0200 Subject: [PATCH] fix(select): assign result of track exp to element value Fixes a regression where the option/select values would always be set to the key or index of a value within the corresponding collection. Prior to some 1.3.0 refactoring, the result of the track expression would be bound to the value, but this behavior was not documented or explicitly tested. This commit adds one explicit test for this behavior, and changes several other trackBy tests to reflect the desired behavior as well. Fixes #9592 --- src/ng/directive/select.js | 22 ++++++-- test/ng/directive/selectSpec.js | 91 ++++++++++++++++++++------------- 2 files changed, 73 insertions(+), 40 deletions(-) diff --git a/src/ng/directive/select.js b/src/ng/directive/select.js index 2f3266b2a131..9ed6d30656cc 100644 --- a/src/ng/directive/select.js +++ b/src/ng/directive/select.js @@ -38,7 +38,8 @@ var ngOptionsMinErr = minErr('ngOptions'); *
* **Note:** Using `select as` will bind the result of the `select as` expression to the model, but * the value of the `