Monday, January 13, 2014

TypeScript: Add properties to an object’s prototype

When you try to add a property to an object’s prototype using TypeScript, you’ll get a compiler error inside Visual Studio.



Too get rid of the error message, you’ll have to create an interface on the prototype object type and declare the function there:

No comments: