简体   繁体   中英

Angular 9 tslint no output rename

I'm using the @Output decorator in an angular 9 project and the code this this:

@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:

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

How can I fix this without having to disable the rule?

This is just a tslint warning. To fix it you should not rename the output.

Try to do something like this:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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