Angular 1.x directives are awesome and they help you reuse your code base by being able to drop directives (aka reuasable HTML elements) into several pages without having to duplicate your code base.
Writing your AngularJS 1.x directives in Typescript will help in the following ways:
Writing Angular 1.x directives in Typescript can be a challenge with only a few examples available online. Most examples of Angular 1.x directives are in JavaScript and converting them to TypeScript versions means you need to have a good understanding of how it all works. Many examples that are available online do it a little differently from each other.
<current-value></current-value>
module app.widgets {'use strict';class CurrentValueDirectiveController {amount: number;static $inject = ['investmentReportsService'];constructor(private investmentReportsService: app.dataServices.InvestmentService) {}setCurrentValue() {this.investmentReportsService.investmentSummary(this.amount).then((response) => {this.currentValue = response.Data.TotalMarket;});}}function CurrentValueDirective(): ng.IDirective {return {restrict = 'E';templateUrl = 'app/widgets/currentValue/currentValue.directive.html';controller = CurrentValueDirectiveController;controllerAs = 'currentValueDirCtrl';bindToController = true;scope = {amount: '='}}}angular.module('app.widgets').directive('currentValue', CurrentValueDirective);}