I've got two select boxes. The first one is changing the entires of the second one. The second one always adjusts it's length to the longest of the actual entries. But it looks wuite ugly if the width always changes when i select another item of the first box.
Is it possible to set the width of the second box to a fixed value, calculated by the longest element of the whole (non-filtered) second box element list? In the scope I can calculate the number of characters of the longest element. Can I adjust this to the width somehow?
I already tried (for testing)
<select ... style="width:{{getMaxLength()}}px" > </select>
returning the number of characters by the method getMaxLength() in the scope. But it didn't change anything.
Did anyone already try this? Setting the size with ng-attr-size worked, but it's the height which does help me nothing.
I'd appreciate every hint or idea! jana
Addition:
My example did not work with the answers because I didn't give the a "name" property. Then the answer from Muhammad Reda worked fine and I'm sure most of the other ideas will work as well. I found out by very thoroughly comparing Muhammads plunker with my code. That was the only difference.