Where do i put my Knockout.js Extensions when using Typescript and requirejs

后端 未结 1 1462
野的像风
野的像风 2021-01-13 00:23

I am in the process of porting some javascript code to typescript and using requirejs. I have a config.ts:

//file config.ts
///

        
相关标签:
1条回答
  • 2021-01-13 00:55

    You can extend existing TypeScript interfaces out of the box. To define your own binding handlers, all you need to do is:

    1. provide a definition file (say myBindings.d.ts)
    2. add the following code

      interface KnockoutBindingHandlers {
          csharpTypes: KnockoutBindingHandler;
      }
      
    3. Reference this definition file in your extensions.ts file
    0 讨论(0)
提交回复
热议问题