0

Im trying to convert this directive into a component, but Im not sure how to go about it.

  export class TableRowBSHeaderDirective implements ng.IDirective {
    restrict: string = 'A';

    templateUrl: any = balanceSheetFSPolicy.dirvmConstant.TableRowHeaderTmpl;

    controller: any = ($scope: any) => {
        balanceSheetFSPolicy.balanceSheetFSViewModel = $scope.bsFsVm;
        $scope.balanceSheetFSPolicy = balanceSheetFSPolicy;
    };

    static factory(): ng.IDirectiveFactory {
        const directive = function () {
            return new TableRowBSHeaderDirective();
        };
        return directive;
    }
}

angular
    .module('app.recon.statements')
    .directive('tableRowBsHeader', TableRowBSHeaderDirective.factory());
  • Possible duplicate of [Angular 1.5 Custom directive to Component](https://stackoverflow.com/questions/35475660/angular-1-5-custom-directive-to-component) – Protozoid Jun 01 '18 at 12:43
  • Also possible duplicate of https://stackoverflow.com/questions/40664609/angular-directive-to-component-angular-1-5?rq=1 – Protozoid Jun 01 '18 at 12:44

0 Answers0