【发布时间】:2019-02-08 22:14:12
【问题描述】:
我有以下代码
async register(user: User){
try {
const result = await this.afAuth.auth.createUserWithEmailAndPassword(user.email, user.password);
this.userRegister();
}
catch {
this.showAlert();
}
}
但是当我运行命令 ionic build --release --prod 时,终端会告诉我以下消息
tslint: C:/Users/Mike/Desktop/GuiaCorretor/src/pages/register/register.ts, line: 39
'result' is declared but its value is never read.
try {
const result = await this.afAuth.auth.createUserWithEmailAndPassword(user.email, user.password);
this.userRegister();
【问题讨论】:
-
我认为这是在抱怨您没有对
result变量做任何事情。尝试只做await this.afAuth.auth.createUserWithEmailAndPassword(user.email, user.password);。听起来像是 linter 错误而不是编译器错误 -
谢谢!请将您的回答作为问题,以便我将问题标记为已解决!
标签: javascript angular typescript ionic3