Skip to content

Instantly share code, notes, and snippets.

View philipbulley's full-sized avatar

Philip Bulley philipbulley

View GitHub Profile
@philipbulley
philipbulley / Controller.ts
Last active March 20, 2023 19:59
Bind all TypeScript class methods to class scope. You get the benefits of fat arrow/lambda functions (`=>`) with the major bonus of inheritance.
/**
* Example of usage in an abstract controller
*/
module base
{
export class Controller
{
constructor()
{
FunctionUtil.bindAllMethods( this );