I am creating a select box directive where, as part of it, I need to specify if the select is multiple or not.
I have tried to set a multiple property in one of my scope objects a value of "multiple" assuming that it shall execute and set multiple="multiple"
on my selectbox as follows:
<select multiple="{{properties.multiple}}" /*...(other working properties)...*/ ></select>
But this got me an error..
Error: [$compile:selmulti] http://errors.angularjs.org/1.4.4/$compile/selmulti?p0=%3Cselect%20id%3D%22…y%20as%20value%20for%20(key%20%2C%20value)%20in%20properties.options%22%3E
at Error (native)
at path/to/angular/angular-1.4.4/angular.min.js:6:416
at X (path/to/angular/angular-1.4.4/angular.min.js:71:93)
at ha (path/to/angular/angular-1.4.4/angular.min.js:56:379)
at S (path/to/angular/angular-1.4.4/angular.min.js:54:425)
at path/to/angular/angular-1.4.4/angular.min.js:68:209
at path/to/angular/angular-1.4.4/angular.min.js:118:217
at n.a.$get.n.$eval (path/to/angular/angular-1.4.4/angular.min.js:133:39)
at n.a.$get.n.$digest (path/to/angular/angular-1.4.4/angular.min.js:130:60)
at n.scopePrototype.$digest (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1955:23)
I can use ng-if
but am trying to find a better approach than making redundant select tags to differentiate between standard and multiple.
What could be a better approach?