Reputation: 1255
As the title suggests I have an internal module in which I require an external module (in this case momentjs) If I just have the module definition and reference this in my other files it compiles fine but of course at runtime I get a 'moment is not defined' error. If I then add:
import moment = require('moment');
then the module gets wrapped in the appropriate require([.....]) code but now my other files won't compile due to the module reference not being found.
What is the best way to fix this?
Upvotes: 0
Views: 202
Reputation: 26
To fix this issue, make sure you have the moment TypeScript definition file included in your project and referenced.
You can include moment as follows:
var moment: moment.MomentStatic = require('moment');
Upvotes: 1