Skip to content

Use md-list-icon in example code #3217

Closed

Description

@BenjaminHofstetter

Bug, feature request, or proposal:

https://material.angular.io/components/component/list

According to the documentation one has to use md-list-icon for md-icon ....


Lists with icons
To add an icon to your list item, use the md-list-icon attribute.

<md-list>
  <md-list-item *ngFor="let message of messages">
    <md-icon md-list-icon>folder</md-icon>
    <h3 md-line> {{message.from}} </h3>
    <p md-line>
      <span> {{message.subject}} </span>
      <span class="demo-2"> -- {{message.content}} </span>
    </p>
  </md-list-item>
</md-list>

But in the example code md-list-avatar is used....

<md-list>
  <h3 md-subheader>Folders</h3>
  <md-list-item *ngFor="let folder of folders">
    <md-icon md-list-avatar>folder</md-icon>
    <h4 md-line>{{folder.name}}</h4>
    <p md-line> {{folder.updated | date}} </p>
  </md-list-item>

...

This leads to misaligned icons

What is the expected behavior?

use md-list-icon in example (with md-icon)

What is the current behavior?

What are the steps to reproduce?

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, browsers are affected?

Is there anything else we should know?

Activity

  1. added
    docs
    help wanted
    on Feb 21, 2017
  2. kara commented on Feb 21, 2017

    @kara
    Contributor

    Yep, that's an error in the example code and should be updated.

  3. added a commit that references this issue on Feb 24, 2017
    bc67bf2
  4. added a commit that references this issue on Feb 26, 2017
    fda8de5
  5. added a commit that references this issue on Apr 16, 2017
    ac476e4
  6. angular-automatic-lock-bot commented on Sep 5, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docshelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions