Here is my current setup:
export class MyComponent implements ng.IComponentOptions {
public static componentName: string = "myViewer";
public bindings: any;
public controller: any;
public controllerAs: any;
public templateUrl: string;
constructor() {
this.bindings = {
configName: '@'
};
this.controllerAs = "ctrl";
this.controller = MyController;
this.templateUrl = 'scripts/components/my-viewer/my-viewer.html';
}
}
I am looking to dynamically specify the templateURL by adding it to the bindings:
this.bindings = {
configName: '@',
templateURL: '=?'
};
To achieve this, I want to use a function for templateURL similar to what can be seen in )
In a previous version of code written in plain JavaScript, I was able to create something like:
templateUrl: function ($element, $attrs) {
return '<SomeLogicToChooseTheTemplate>';
}
My question now is how do I implement a similar solution in the Typescript version?