From b8ea7f6aba2e675b85826b0bee1f21ddd7b866a5 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 24 May 2013 11:00:14 -0700 Subject: feat(ngError): add error message compression and better error messages - add toThrowNg matcher --- src/ng/directive/select.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ng/directive/select.js') diff --git a/src/ng/directive/select.js b/src/ng/directive/select.js index 7a1cab53..6dda33f5 100644 --- a/src/ng/directive/select.js +++ b/src/ng/directive/select.js @@ -300,9 +300,9 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) { var match; if (! (match = optionsExp.match(NG_OPTIONS_REGEXP))) { - throw Error( - "Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_ (track by _expr_)?'" + - " but got '" + optionsExp + "'."); + throw ngError(9, + "ngOptions error! Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}", + optionsExp, startingTag(selectElement)); } var displayFn = $parse(match[2] || match[1]), @@ -357,7 +357,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) { for (var trackIndex = 0; trackIndex < collection.length; trackIndex++) { locals[valueName] = collection[trackIndex]; if (trackFn(scope, locals) == key) break; - } + } } else { locals[valueName] = collection[key]; } -- cgit v1.2.3