Creating directives using TypeScript classes