material-smart-form
TypeScript icon, indicating that this package has built-in type declarations

0.0.21 • Public • Published

Angular Material Smart Form

This library is supposed to help developers make forms fast and easy. It is useful specially for admin dashboards in which customizing UI is not that imoportant.

Get Started

install the package

npm install material-smart-form --save

import the module in your own module.

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, BrowserAnimationsModule, MaterialSmartFormModule],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}

Usage

The simplest usage of this component could be so:

in you component's template file:

<ng-smart-form
  [schema]="formSchema"
  [values]="values"
  [isSubmitting]="isSubmitting"
  (formSubmit)="submit($event)"
>
</ng-smart-form>

and in your component:

isSubmitting: boolean;

formSchema: FormSchema = {
	name: {
		type: FormFieldTypes.Text,
	},
}

values: {
	name: 'John',
}

submit(values: {name: string}) {
  this.isSubmitting = true;
  setTimeout(() => {
    this.isSubmitting = false;
  }, 2000);
}

Demo

git clone https://github.com/poormohammadi/ng-smart-form.git
cd ng-smart-form
npm i
npm start

Readme

Keywords

none

Package Sidebar

Install

npm i material-smart-form

Weekly Downloads

1

Version

0.0.21

License

none

Unpacked Size

1.39 MB

Total Files

116

Last publish

Collaborators

  • poormohammadi