How do I define a knockout binding handler in typescript?

前端 未结 3 1068
隐瞒了意图╮
隐瞒了意图╮ 2021-02-03 18:29

I normally add custom knockout binding handlers in JavaScript via

ko.bindingHandlers.myBindingHandler = {...}

but now I have to add them in Ty

3条回答
  •  执笔经年
    2021-02-03 19:25

    Another dirty way to ignore any kind of type checking:

    let bindingHandlers: any = ko.bindingHandlers;
    bindingHandlers.myHandler = {...}
    

提交回复
热议问题