Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wizard-texts.ts is incorrectly typed #113

Open
kvaren opened this issue Apr 19, 2022 · 1 comment
Open

wizard-texts.ts is incorrectly typed #113

kvaren opened this issue Apr 19, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@kvaren
Copy link

kvaren commented Apr 19, 2022

Issue:

After installing and implementing the wizard I kept getting this error (and similar for each property in the model):

Error: node_modules/@sebgroup/ng-wizard/lib/models/wizard-texts.d.ts:2:5 - error TS2411: Property 'wiz_next_action' of type 'string | undefined' is not assignable to string index type 'string'.

2     wiz_next_action?: string;
      ~~~~~~~~~~~~~~~

The package itself has the strict property set to false in tsconfig, which is the reason why the package itself won't complain about this error. But as soon as the main project has strict set to true the error pasted above will appear.

Proposed solution:

Fix wizard-texts.ts model by correctly setting the types:

export interface WizardTexts {
    wiz_next_action?: string;
    wiz_prev_action?: string;
    wiz_close_action?: string;
    wiz_save_action?: string;
    wiz_header_title?: string;
    wiz_step_description?: string;
    [key: string]: string | undefined;
}

and set strict to true in tsconfig, since this is the default behavior of Angular projects.

If this is not fixed every project that wants to use the wizard won't be able to have strict typing enabled.

@hjalmers
Copy link
Contributor

Thanks for reporting @kvaren, would mind making a pull request by any chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants