Skip to content

Installation

At this time this package is only compatible with Angular 19.2.1 or above.

Running the following command will install ngx-formwork.

Terminal window
ng add ngx-formwork

By default, the following things will be done

  • Add ngx-formwork as a dependency
  • Create a registration configuration file
  • Setup token based registration including
    • barrel export
    • component registration
    • validator registration
    • async validator registration
  • Setup helper files including
    • barrel export
    • control host directives
    • control container view provider
  • Create a schematics configuration file
  • Provide formwork in your app.config.ts
  • Install dependencies
OptionTypeRequiredDefaultDescription
—projectstringNoworkspace default projectAngular project to add ngx-formwork to.
—registrationStyletoken | configNotokenThe registration style to be used.
—provideInlinebooleanNofalsePut the provider configuration object of provideFormwork inline, instead of putting it in a separate file.
—providerConfigPathstringNoappWhere the provider configuration file should be placed, relative to the project root.
—providerConfigFileNamestringNoformwork.config.tsName of the provider configuration file.
—includeSyncValidatorsbooleanNotrueWhether to include the setup for validators.
—includeAsyncValidatorsbooleanNotrueWhether to include the setup for async validators.
—useHelperbooleanNotrueInclude helper files for view providers and host directives.
—helperPathstringNoapp/shared/helperWhere helper files should be placed, relative to the project root.
—splitRegistrationsbooleanNotrueWhether to split the registrations into a separate file. If false, registrations will happen directly in the formwork.config.ts or app.config.ts, depending on the registration style and the provideInline option.
—registrationsPathstringNoapp/registrationsWhere registration files should be placed, relative to the project root.
—useSchematicConfigbooleanNotrueWhether to include an extra file for schematics configuration. If set to false, all configuration for the schematics will be set up in angular.json.
—schematicsConfigPathstringNoappWhere the schematics config should be placed, relative to the project root.
—schematicConfigFileNamestringNoformwork.config.jsonName of the schematic config file.

For manual setup and configuration, see the Manual Setup guide.