1.6.3 • Published 3 years ago

angular-easy-form v1.6.3

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

*warning - this version is release, not use it in production

Permit create forms in Angular easier and fast.

Get Started

NPM

npm install angular-easy-form

Usage

  

// add import AngularEasyFormModule

import { AngularEasyFormModule } from  'angular-easy-form';

@NgModule({

  declarations: [

    AppComponent,

  ],

  imports: [

    CommonModule,

    BrowserModule,

    ReactiveFormsModule,

    BrowserAnimationsModule,

    AngularEasyFormModule,

  ],

providers: [],

bootstrap: [AppComponent]

})

export  class  AppModule { }

In your component's template file "app.component.html" you have add tag lib-angular-easy-form

<lib-angular-easy-form
(eventsForm)="eventForm($event)">
</lib-angular-easy-form>

The configForm is passed all configuration form. You should create a method to get events of form.

eventForm(event: any) {

// get events(events:any)

}
ParameterDescriptionTypeExample
styleStyle of main formstring{ style: 'background-color: red;' }
fieldsFields define the fields and parametersarraysee above complete example
typeType of the fieldstringtext, email, date, number, checkbox , textarea, searchInput
aliasUnique identificator of the fieldstring---
labelLabel of fieldstringIf not exist lable only show input field
disableDisable of inputbooleanif true the input became disabled
placeholderShow text in imputstringonly util when input permit placeholder
valueSet default value in fieldstring----
requiredSet if the field is requidedbooleanbuy default is false
maxLengthSet size of fieldnumbermaxLength: 5
miniLengthSet size of fieldnumberminiLength: 5
patternSet regex in fieldanypattern:'a-zA-Z *'

Example of configForm

  • Type and alias are mandatory

       import { options } from 'angular-easy-form';
       
        export class YourComponent implements OnInit, AfterViewInit {
           ngOnInit() {
             const formCreator = options.formOptions();
             formCreator.matriz = [2];
    
             formCreator.field().text({
               type: 'text', alias: 'f1', label: 'Teste 1', disable: false, placeholder: 'oi',
               value: '', style: '', required: true
             });
             formCreator.field().text({
               type: 'text', alias: 'f2', label: 'Teste 2', disable: false, placeholder: 'oi',
               value: '', style: '', required: true
             });
             this.setConfig = formCreator.build();
         }
## The form automatically rendering



![alt tag](https://github.com/renatodysouza/easyform/blob/master/form.PNG)


### Events

The event object return ken with alias of field and value. Contain to if the field is valid and formGroup instance


 ```javascript
     f1: {
        formGroup: FormGroup,
        isValid: true,
        value: {f1: "yourValue"}

    }

Compatible with Angular Ivy

has not been processed correctly by ngcc, or is not compatible with Angular Ivy

Resolve this:

package.json
  content_copy
  {
    "scripts": {
      "postinstall": "ngcc"
    }
  }
  npm run postinstall

License

This project is licensed under the terms of the MIT license.

1.4.6

3 years ago

1.2.8

3 years ago

1.6.3

3 years ago

1.2.7

3 years ago

1.6.2

3 years ago

1.4.4

3 years ago

1.2.6

3 years ago

1.6.1

3 years ago

1.4.3

3 years ago

1.6.0

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.5.9

3 years ago

1.5.8

3 years ago

1.5.7

3 years ago

1.3.9

3 years ago

1.5.6

3 years ago

1.3.8

3 years ago

1.5.5

3 years ago

1.3.7

3 years ago

1.5.4

3 years ago

1.3.6

3 years ago

1.5.3

3 years ago

1.3.5

3 years ago

1.5.2

3 years ago

1.3.4

3 years ago

1.5.1

3 years ago

1.3.3

3 years ago

1.5.0

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.4.9

3 years ago

1.4.8

3 years ago

1.4.7

3 years ago

1.4.54

3 years ago

1.2.9

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.3

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago