ngxtension / ngxtension-platform

Utilities for Angular

Home Page:https://ngxtension.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: migration outputs enhancements

eneajaho opened this issue · comments

  • remove Output from imports if not used anymore
  • append output to existing import from angular/core
  • migrate the following case correctly
@Output() someOutput: EventEmitter<DataInterface> = new EventEmitter();

// currently
someOutput = output();

// should be
someOutput = output<DataInterface>();

More ideas are welcome 🤗

Hi @eneajaho, I encountered the following problem during migration. In my application I used:

@Output() private readonly testChange = new EventEmitter<any>();

After migration I got

private readonly testChange = output<any>();

But when I tried to run the application I received the following error:

error NG1053: Cannot use "output" on a class member that is declared as private. Update the class field to be either: public, public readonly, protected

The error was easily resolved by replacing private with protected

Maybe it’s worth considering this case in migration?

Hi, yeah that would be great to be added. Thanks for sharing.