How to use material2 toolbar, button and angular-cli router

后端 未结 1 1924
执念已碎
执念已碎 2021-01-05 19:30

I have the following files:

.html

相关标签:
1条回答
  • 2021-01-05 19:51

    Your issue is because the new Router doesn't accept [routerLink] on <button> elements, only <a> tags.

    But you're in luck, Material lets you do the icon on <a> and <button>

    Material Docs on md-button

    So try this:

    <a md-icon-button
            [routerLink] = "['new-patient']"
            color = "accent">
      <md-icon class = "material-icons md-24">person_add</md-icon>
    </a>
    
    0 讨论(0)
提交回复
热议问题