简体   繁体   English

Angular 9 tslint 没有 output 重命名

[英]Angular 9 tslint no output rename

I'm using the @Output decorator in an angular 9 project and the code this this:我在 angular 9 项目中使用 @Output 装饰器,代码如下:

@Output('myMethod') myMethod: EventEmitter<any> = new EventEmitter();

Typescript gives my an error and forces me to add this about the code in order to remove the error: Typescript 给了我一个错误并强迫我添加这个关于代码以消除错误:

// tslint:disable-next-line:no-output-rename

How can I fix this without having to disable the rule?如何在不必禁用规则的情况下解决此问题?

This is just a tslint warning.这只是一个 tslint 警告。 To fix it you should not rename the output.要修复它,您不应重命名 output。

Try to do something like this:尝试做这样的事情:

 @Output() myMethod: EventEmitter<any> = new EventEmitter();

@Output() myMethod: EventEmitter<any> = new EventEmitter();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM