I'm trying to implement a typescript directive, but I can't seem to pass my vars to the directive, this is my current directive
namespace app {
'use strict';
export interface IMyScope {
// ngModel: Date;
testing: string;
}
class DateTime implements angular.IDirective {
public restrict: string = 'E';
public template: string = '<div>Input: {{testing | json}}</div>';
public scope: any = {
testing: '='
};
// @ngInject
controller: any = ($scope: IMyScope): void => {
console.log($scope.testing);
};
link: any = (scope: IMyScope ,
element: angular.IAugmentedJQuery,
attrs: angular.IAttributes,
ctrl: any): void => {
console.log(scope.testing);
}
}
angular
.module('app')
.directive('dateTime', [() => new DateTime()]);
}
but the logs in my link and controller return undefined
any clues why this is happening?