How do I define a knockout binding handler in typescript?

前端 未结 3 1075
隐瞒了意图╮
隐瞒了意图╮ 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:13

    you can simply ignore it,but this is not a good practice, by casting to any you are not defining the type of the property myBindingHandler

    (ko.bindingHandlers).myBindingHandler = { ... };
    

提交回复
热议问题