@dr-angular/form-material-builder
v0.0.6
Published
A very useful tool for building dynamic forms using angular material. ___
Downloads
23
Readme
A very useful tool for building dynamic forms using angular material.
This pack requires @dr-angular/form-material.
npm i @dr-angular/form-material
Install the library and import the "FormMaterialModule" and "FormMaterialBuilderModule" module
// ...
import { FormMaterialModule } from '@dr-angular/form-material';
import { FormMaterialBuilderModule } from '@dr-angular/form-material-builder';
@NgModule({
declarations: [
AppComponent
],
imports: [
FormMaterialModule,
FormMaterialBuilderModule
]
})
export class AppModule { }
Some examples of how to use the component
Using selector "dr-form-material-builder" to show the builder in a component:
<h2>Form Builder</h2>
<dr-form-material-builder></dr-form-material-builder>
Using component "FormMaterialBuilderComponent" as redirect url to show the builder in a component:
import { FormMaterialBuilderComponent } from '@dr-angular/form-material-builder';
const routes: Routes = [
{ path: '', redirectTo: 'form-builder', pathMatch: 'full' },
{ path: 'form-builder', component: FormMaterialBuilderComponent }
];
An example of how to use the component
<div *ngIf="jsonHero">
<dr-form-material [jsonForm]="jsonHero" (formSubmit)="formSubmitted=$event">
</dr-form-material>
</div>
{{formSubmitted | json}}