我有一段 TypeScript 代码:
export class AppModule {
constructor(private s: ActiveCartService){
if( s === undefined){
console.log(s);
}
s.isStable().subscribe((data) => console.log('isStable: ' , data));
}
}
引起如下错误消息:
Error TS6138 - Property xxxx is declared but its value is never read
解决方法:
修改 tsconfig.json
:
将下列参数改成 false 即可:
"noUnusedLocals": false,
"noUnusedParameters": false,
问题解决:
网友评论