I needed to utilize a typescript function from another file, but I encountered an issue:
I created a file called Module.ts with the following code snippet:
export function CustomDirective(): ng.IDirective {
var directive: ng.IDirective = <ng.IDirective>{//Filling directive here
};
return directive;
}
Next, in app.ts (within the same folder), I attempted to import this file and use it like so:
angular.module(...).directive('name', CustomDirective())
I tried different ways to import the file:
import 'Module';
import Module = require('Module');//
import * as Module from 'Module'; // this two with Module.CustomFirective();
However, whenever I attempt to import it, I receive an error stating that Module cannot be found. Additionally, PublicController and BusyIndicator also become inaccessible.
Can you advise me on how to properly insert a file with a function?