@dynamic-field-kit/angular
v1.0.2
Published
Lightweight Angular adapters for `@dynamic-field-kit/core`.
Downloads
211
Maintainers
Readme
@dynamic-field-kit/angular
Lightweight Angular adapters for @dynamic-field-kit/core.
This package mirrors the React package structure and exposes Angular components that integrate with the shared fieldRegistry from @dynamic-field-kit/core.
Quick overview
- Exports a minimal Angular integration:
DynamicInput,FieldInput,MultiFieldInput, layout components andDynamicFieldKitModule(seesrc/public-api.ts). - Designed for local development (source import) and can be packaged with
ng-packagrfor distribution.
Usage (consumer Angular app)
- Install the package (recommended: use packaged artifact or local
file:during development):
# from your Angular app
npm install @dynamic-field-kit/core @dynamic-field-kit/angular- Import the module in your
AppModule:
import { DynamicFieldKitModule } from '@dynamic-field-kit/angular'
@NgModule({
imports: [BrowserModule, DynamicFieldKitModule],
})
export class AppModule {}- Register Angular component classes into the shared registry at app startup (example):
// src/main.ts
import '@dynamic-field-kit/angular/src/examples' // registers example component into fieldRegistryThen use the Angular adapter components (dfk-multi-field-input, etc.) in templates.
Local development
- You can import the package source directly in your Angular app using
file:references inpackage.json(seeexample/angular-instructions.mdandexample/angular-app/for a scaffold).
Build & publish
- This package supports
ng-packagr. To build locally:
cd packages/angular
npm install --no-audit --no-fund --save-dev ng-packagr rimraf
npm run build- To publish to npm (scoped package), ensure
publishConfig.accessispublicand run:
cd packages/angular
npm publish --access publicNotes & caveats
- The Angular adapter expects consumers to register Angular component classes (not React components) in
fieldRegistrywhen using the Angular runtime. - The package exports a
DynamicFieldKitModuleto simplify consumer imports, and also provides standalone components for more advanced composition.
Examples & docs
- See
example/angular-instructions.mdfor detailed wiring steps. - Try the local scaffold at
example/angular-app/for a hands-on demo.
