将其绑定到模板angular 4

时间:2018-08-08 05:25:43

标签: jquery angular5

我正在用angular 5开发一个项目,我需要使用jQuery删除一些html div

<div class="col-1 removebtn" style="padding-left:35px" (click)="removeConditions(this)">
                <input style="background-color:#9b96b0" class="btn btn-primary" type="button" name="btn3" value="-">
              </div>

removeConditions(ev) {
    if ($('.search_criteria1').length < 2)
      $(ev).closest('.removebtn').attr('disabled', 'disabled')
    else {
      $(ev).closest('.search_criteria1').remove();
      $(ev).closest('.removebtn').attr('disabled', '')
    }

  }

像这样绑定

(click)="removeConditions(this)" , but i'm getting component context as this .

0 个答案:

没有答案