簡體   English   中英

Kendo ui用於angular:將kendoButton的click事件綁定到組件中變量的方法

[英]Kendo ui for angular: bind click event of kendoButton to a method of a variable in the component

我有一個類型為“ any”的組件變量“消息”,其中包含方法“ actionnowrapper()”

每當我綁定到如下所示的按鈕時,此方法就可以很好地工作。

<button (click)="message.actionnowrapper()"></button>

每當我使用kendoButton指令時,此功能就不再起作用。

<button kendoButton (click)="message.actionnowrapper()"></button>

將Kendobutton直接綁定到組件中的方法可以解決問題,但這不是我們所需要的。

 <button (click)="actionnowrapper()"></button>

如何將kendobutton綁定到組件變量中的方法?

謝謝!

常規按鈕和Kendo按鈕單擊處理程序的工作方式相同:

<button kendoButton (click)="message.actionnowrapper('kendo')">Click</button>
<button (click)="message.actionnowrapper('regular')">Click</button>

export class AppComponent {
message = {
  actionnowrapper: (buttonType: string) => {
      alert(`${buttonType} button clicked`)
    } 
  }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM