* ng如果没有在Modal中工作

时间:2017-11-09 23:25:55

标签: angular typescript angular2-template ngx-bootstrap

我在一个按钮上使用了* ngif,当从ng-select中选择该项但它不起作用时,该按钮会生效

这是按钮代码

final

这是Modal的整个代码

  <button *ngIf="switch" (click)="productSaveInCart()" type="button" class="col  matbuton " mat-button>
          ADD to Cart
        </button>

1 个答案:

答案 0 :(得分:1)

试试这个:

(selected)="selected($event);switch=true"

你可以使用隐藏的方式:它应该工作

[hidden]="switch"
相关问题