Derek 朕會功夫
Derek 朕會功夫

Reputation: 94319

Angular Material - move md-secondary to the left

How do you move a md-secondary button to the left side instead of the default right side? Normally

<md-list-item ng-click="foo()">
    <span>Stuff</span>
    <md-icon class="md-secondary" ng-click="bar()">icon</md-icon>
</md-icon-item>

this creates a nice list item, but I want the icon to be on the left. I tried reordering the elements

<md-list-item ng-click="foo()">
    <md-icon class="md-secondary" ng-click="bar()">icon</md-icon>
    <span>Stuff</span>
</md-icon-item>

but that doesn't work.

Upvotes: 0

Views: 531

Answers (1)

Trevor
Trevor

Reputation: 13457

Change the class from md-secondary to md-primary.

<md-list>
  <md-list-item ng-click="itemClick()">
    <md-button class="md-icon-button" ng-click="btnClick()">
      <md-icon class="md-primary" md-font-icon="mdi-web"></md-icon>
    </md-button>
    <span>Stuff</span>
  </md-list-item>
</md-list>

See this codepen for a more detailed example.

Upvotes: 2

Related Questions