Skip to content

bug: ModalOptions no longer accepts a Type parameter #31012

@Ionaru

Description

@Ionaru

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

Using this code:

import { ModalOptions } from '@ionic/angular';

const modal = await this.modalController.create({
  component: MyModalComponent,
} satisfies ModalOptions<MyModalComponent>);

It errors:

[ERROR] TS2315: Type 'ModalOptions' is not generic.

Expected Behavior

This code:

import { ModalOptions } from '@ionic/angular';

const modal = await this.modalController.create({
  component: MyModalComponent,
} satisfies ModalOptions<MyModalComponent>);

Should not error and correctly verify that component is MyModalComponent

Steps to Reproduce

N/A

Code Reproduction URL

N/A

Ionic Info

N/A

Additional Information

Bug introduced in #30899, specifically in commit 641f319.

Ionic 8.8.0 was the first version with this bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions