aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content
diff options
context:
space:
mode:
authorMisko Hevery2013-08-01 15:53:59 -0700
committerIgor Minar2013-08-08 17:16:46 -0700
commitdbd703a9fb864b787bc90c45fd4eb5ded7422f24 (patch)
tree880684938281d00787d63178e2780a303279880e /docs/content
parentfa3985764c1636fb408f18516dc47933ca0def44 (diff)
downloadangular.js-dbd703a9fb864b787bc90c45fd4eb5ded7422f24.tar.bz2
docs(compile/selmulti): description for compile/selmulti error
Closes #3459
Diffstat (limited to 'docs/content')
-rw-r--r--docs/content/error/compile/selmulti.ngdoc16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/content/error/compile/selmulti.ngdoc b/docs/content/error/compile/selmulti.ngdoc
index d737ca35..8154cc67 100644
--- a/docs/content/error/compile/selmulti.ngdoc
+++ b/docs/content/error/compile/selmulti.ngdoc
@@ -2,3 +2,19 @@
@name $compile:selmulti
@fullName Binding to Multiple Attribute
@description
+
+Binding to the `multiple` attribute of `select` element is not supported since switching between multiple and single mode changes the {@link api/ng.directive:ngModel `ngModel`} object type from instance to array of instances which breaks the model semantics.
+
+If you need to use different types of `select` elements in your template based on some variable, please use {@link api/ng.directive:ngIf ngIf} or {@link api/ng.directive:ngSwitch ngSwitch} directives to select one of them to be used at runtime.
+
+
+Example with invalid usage:
+```
+<select ng-model="some.model" multiple="{{mode}}"></select>
+```
+
+Example that uses ngIf to pick one of the `select` elements based on a variable:
+```
+<select ng-if="mode == 'multiple'" ng-model="some.model" multiple></select>
+<select ng-if="mode != 'multiple'" ng-model="some.model"></select>
+```