ng-bootstrap / ng-bootstrap/ng-bootstrap

Correctly typed NgbModalRef.componentInstance

Open
#4,767 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
8.2k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Feature request:

Have you considered to use generics in NgbModal.open to return NgbModalRef.componentInstance with component type instead of any? That would make it a bit more safe when setting component instance fields.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with NgbModal.open and NgbModalRef.componentInstance, tracing their public type declarations and implementation. Update the API so the opened component type is preserved instead of any, then verify that consumers receive the correct componentInstance type and add or update relevant typing coverage if present.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, bootstrap, typescript
Domain
api, frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.