Reputation: 397
I wanted to use a typescrypt function from another file, but there is a problem:
I made a file Module.ts with an
export function CustomDirective(): ng.IDirective {
var directive: ng.IDirective = <ng.IDirective>{//Filling directive here
};
return directive;
}
In app.ts (same folder) I tried to import this file and use in
angular.module(...).directive('name', CustomDirective())
I tried to use
import 'Module';
import Module = require('Module');//
import * as Module from 'Module'; // this two with Module.CustomFirective();
But if there is an import, there accures an error that Module cannot be found. And PublicController, BusyIndicator become also not found.
How do I insert file with a function properly?
Upvotes: 0
Views: 477