Skip to content

output-migration Removes types from output #59248

@blogcraft

Description

@blogcraft

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

When running a migration ng generate @angular/core:output-migration

My @outputs when migrating to output lose the type causing errors everywhere.

Image

Instead of turning this
@Output() EventMoveMovimientos: EventEmitter<resupuesta> = new EventEmitter();
into
readonly EventMoveMovimientos = output();

It should be into this
readonly EventMoveMovimientos = output<resupuesta>();

By the way the event emit is this:

this.EventMoveMovimientos.emit({
  idInstrumento: nemo.idNemotecnico,
  idCuenta: nemo.idCuenta,
});

And the interface is this:

export interface resupuesta {
  idInstrumento: number;
  idCuenta: number;
}

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

X [ERROR] TS2345: Argument of type '{ idInstrumento: any; idCuenta: any; }' is not assignable to parameter of type 'void'. [plugin angular-compiler]

    src/app/modules/shared-module/tabla-instrumento/forward/forward.component.ts:97:35:
      97 │     this.EventMoveMovimientos.emit({
         ╵                                    ^

Please provide the environment you discovered this bug in (run ng version)

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 19.0.6
Node: 20.13.1
Package Manager: npm 10.5.2
OS: win32 x64

Angular: 19.0.5
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.6
@angular-devkit/build-angular   19.0.6
@angular-devkit/core            19.0.6 (cli-only)
@angular-devkit/schematics      19.0.6
@angular/cdk                    19.0.4
@angular/cli                    19.0.6
@angular/flex-layout            15.0.0-beta.42
@angular/material               19.0.4
@schematics/angular             19.0.6
rxjs                            7.8.1
typescript                      5.5.3
zone.js                         0.15.0

Anything else?

No response

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions