Skip to content Skip to sidebar Skip to footer

Where Do I Put My Knockout.js Extensions When Using Typescript And Requirejs

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

Solution 1:

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

    interfaceKnockoutBindingHandlers {
        csharpTypes: KnockoutBindingHandler;
    }
    
  3. Reference this definition file in your extensions.ts file

Post a Comment for "Where Do I Put My Knockout.js Extensions When Using Typescript And Requirejs"