aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/error/$compile/selmulti.ngdoc
diff options
context:
space:
mode:
authorPeter Bacon Darwin2014-02-16 22:02:31 +0000
committerPeter Bacon Darwin2014-02-16 22:02:41 +0000
commit33e1bdc543bcb7875dcc004d487333393670ed2d (patch)
tree7ff1f564ab486f049b7e9e5ad946a6a88bb651b6 /docs/content/error/$compile/selmulti.ngdoc
parent49f90e559ed412402ad7444bc2db2bc1c182ddf5 (diff)
downloadangular.js-33e1bdc543bcb7875dcc004d487333393670ed2d.tar.bz2
chore(errors): rename folders to match namespaces
Diffstat (limited to 'docs/content/error/$compile/selmulti.ngdoc')
-rw-r--r--docs/content/error/$compile/selmulti.ngdoc20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/content/error/$compile/selmulti.ngdoc b/docs/content/error/$compile/selmulti.ngdoc
new file mode 100644
index 00000000..51221ad8
--- /dev/null
+++ b/docs/content/error/$compile/selmulti.ngdoc
@@ -0,0 +1,20 @@
+@ngdoc error
+@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 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 ng.directive:ngIf ngIf} or {@link 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>
+```