Installation
Compatibility
Section titled “Compatibility”At this time this package is only compatible with Angular 19.2.1 or above.
Primary Installation via Angular Schematic (ng-add)
Section titled “Primary Installation via Angular Schematic (ng-add)”Running the following command will install ngx-formwork, configure your application providers, and register the core schematics:
ng add ngx-formwork
This schematic by default will set up most helper files as described on the Improvements & DRY Code Page. This will allow for less repetitive code. The other Schematics will pick up on those helper files.
Options
Section titled “Options”Option | Type | Required | Default | Description |
---|---|---|---|---|
—project | string | No | workspace default project | Angular project to add ngx-formwork to. |
—helper | boolean | No | true | Include helper files for view providers and host directives. |
—helperPath | string | No | [projectRoot]/src/app/shared/helper | Path to place generated helper files if --helper is enabled. This path has to be an absolut path. |
What Changes Are Made
Section titled “What Changes Are Made”When you run the schematic, it performs the following steps:
- Adds the
ngx-formwork
dependency to yourpackage.json
with version^0.6.0
. - Generates base Formwork configuration files (e.g.,
formwork.config.ts
) undersrc/app
. - Updates
angular.json
to register the default control, group, and block schematics. - Modifies
app.config.ts
(orAppModule
) to:- Insert imports for
provideFormwork
andformworkConfig
. - Add
provideFormwork(formworkConfig)
to theappConfig.providers
array.
- Insert imports for
- If
--helper
is enabled:- Creates helper files (
control-container.view-provider.ts
,<type>.host-directive.ts
) under the specified--helperPath
. - Updates the schematic defaults in
angular.json
to reference the helper path forcontrol
,group
, andblock
.
- Creates helper files (
- Runs
npm install
to install the added dependencies.
Manual Installation
Section titled “Manual Installation”For manual setup and configuration, see the Manual Setup guide.