I'm building a directive which supposed to take html file, place it in dom and compile it with angular's compile
I'm getting an error:
$templateRequest is not a function
Clearly I am doing something wrong, don't know what,
This is my directive:
module Uni.Directives {
export class uniTable implements ng.IDirective {
public restrict: string = 'EA';
public link: Function = (scope: ng.IScope,
$templateRequest: ng.ITemplateRequestService,
$compile: ng.ICompileService,
element: ng.IAugmentedJQuery,
attrs: ng.IAttributes) => {
$templateRequest("template.html",false).then(function (html) {
var template = angular.element(html);
element.append(template);
$compile(template)(scope);
});
}
}
angular
.module('TModule')
.directive('uniTable', [() => { return new Uni.Directives.uniTable() }]);
// ******** End adding to module **********
}