【发布时间】:2015-02-16 22:12:12
【问题描述】:
我正在使用 Meteor 和 TypeScript 开发一个 Web 应用程序,也使用 Nitrous.io 环境。
我正在尝试实施用户帐户系统。我正在修改旧项目中的 JavaScript 代码(它有效),但我仍然遇到错误。这是来自 login.ts 文件:
// retrieve the input field values
var email = template.$('[name=email]').val();
var password = template.$('[name=password]').val();
var errors = {};
if (! email) {
errors.email = 'Please enter your email address'; // ERROR HERE
}
if (! password) {
errors.password = 'Please enter your password'; // ERROR HERE
}
我收到的错误消息是:
/client/login.ts(41,20): error TS2094: The property 'email' does not exist on value of type '{}'.
/client/login.ts(45,20): error TS2094: The property 'password' does not exist on value of type '{}'.
有什么想法吗?谢谢。 :)
【问题讨论】:
标签: meteor typescript nitrousio meteor-accounts typescript1.4