Angular 按钮的href属性中的插值

Angular 按钮的href属性中的插值,angular,Angular,我试图在按钮元素中使用href;当我尝试href=collapse时 它工作得很好,但当我执行href=collapse-{{option.name}时,会出现此错误 无法绑定到“href”,因为它不是“button”的已知属性 如何为按钮在href atribute中添加插值 这是我的密码 <div *ngFor="let option of menuOptions"> <button type="button&quo

我试图在按钮元素中使用href;当我尝试href=collapse时 它工作得很好,但当我执行href=collapse-{{option.name}时,会出现此错误

无法绑定到“href”,因为它不是“button”的已知属性

如何为按钮在href atribute中添加插值

这是我的密码

    <div *ngFor="let option of menuOptions">
          <button type="button" data-toggle="collapse" href="#collapse-{{option.name}}" class="list-group-item list-group-item-action">
            <p><i-feather name="{{option.featherName}}" data-feather="option.featherName" class="sidebar-icons"></i-feather>{{option.name}}</p>
          </button>
</div>

您是否尝试过以下方法:

我不确定“按钮”上是否有“href”,但嘿。。。 如果[href]不起作用

[attr.href]应该完成这项工作

<button [attr.href]="'#collapse-' + option.name">
我也不确定按钮上是否有href