FormNodesModule
FormNodesModule is an Angular NgModule that imports and re-exports the library's template
features. Currently it exports FormNodeDirective, which supplies
the [formNode] binding. Import the module from @ngblocks/form-nodes in a standalone component
or an application's NgModule.
import { Component } from '@angular/core';
import { field, form, FormNodesModule } from '@ngblocks/form-nodes';
@Component({
selector: 'app-profile-editor',
imports: [FormNodesModule],
template: `
<form [formNode]="form">
<label>Name <input [formNode]="form.name" /></label>
</form>
`,
})
export class ProfileEditorComponent {
form = form({ name: field('Marco') });
}
The module is a single import point for the library's Angular template features. You can also
continue importing FormNodeDirective directly when you want to list individual dependencies.
The module does not configure providers or change form behavior. Use
provideFormNodesConfig() for configuration.
field(), form(), group(), array(), validators, and node types remain ordinary TypeScript
imports from the package. They do not belong in Angular component or module imports arrays.