【发布时间】:2015-06-29 23:13:22
【问题描述】:
将我的 Sails.js 应用程序转换为使用 TypeScript,当我尝试访问之前的路线时,我遇到了有关“TypeError:对象不是函数”的错误。
我使用类创建了一个控制器,并在 TypeScript 中重新编写了我的函数。最后我实例化了我的新控制器
var controller = new TestController();
export = controller;
我不明白我在这里做错了什么。我参考了在http://alexclavelle.blogspot.com/2015/03/using-sailsjs-with-typescript.html?showComment=1435617822375上完成的工作
还是什么都没有……我猜这是生成的 es5 代码。
【问题讨论】:
标签: javascript node.js typescript sails.js