Angular2 Material Design Select Component - Styling selected Item

329 Views Asked by At

I'm using the <md-select>component of Angular2 Material to switch list layouts (grid or bullet list). When a layout has been chosen, the select-box should only show an icon. When choosing a layout the menu is showing both the icon and text.

Here's what it should look like

select icon without text

this is what the selection menu looks like:

enter image description here

my code so far:

<md-select [(ngModel)]="selectedViewState">
    <md-option *ngFor="let viewState of viewStates" [value]="viewState.icon">
        <i class="mdi {{viewState.icon}}"></i> {{viewState.title}}
    </md-option>
</md-select>

So, how can I style this? I didn't find anything regarding this in the docs.

0

There are 0 best solutions below