Skip to content

Clarify Configuration Instructions for Standalone vs. Module-based Angular Applications #1529

@satyam-mishra-dev

Description

@satyam-mishra-dev

he current readme provides instructions for using both the new bootstrapApplication approach with standalone components (using providers such as provideEnvironmentNgxMask and provideNgxMask) and the traditional Angular modules approach with NgxMaskModule.forRoot(). However, the documentation could be improved in the following ways:

Ambiguity Between Providers:
The distinction between provideEnvironmentNgxMask and provideNgxMask is not clearly explained. It’s not immediately evident when one should be used over the other, especially for developers transitioning to Angular’s standalone component model from the module-based system.

Contextual Guidance for Different Angular Versions:
While there are version-specific installation commands, the readme does not explicitly guide users on how the configuration might differ (or what pitfalls might arise) when using Angular versions that support standalone components (Angular 15 and above) versus older versions.

Usage Examples & Error Handling:
The examples show different configuration methods (default config, passing your own options, using a function) without a deeper explanation on how these approaches affect application behavior. It would be beneficial to include notes on potential errors or misconfigurations that might occur if the wrong provider is used in a given context.

Linking to Extended Examples and Troubleshooting:
There is a brief mention of live documentation with examples, but the readme could integrate direct links or references to extended examples specifically covering the nuances of the two approaches. This would help reduce confusion and improve the developer experience.

Proposed Resolution:

Add a section that outlines the scenarios for using each configuration method, with bullet points or a decision tree.

Provide clear examples side-by-side comparing the usage in standalone component setups versus traditional module imports.

Include common pitfalls and debugging tips for misconfiguration issues when integrating ngx-mask in different Angular projects.

Offer direct links to further documentation or demo projects showcasing the recommended patterns.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions