2.0.0 • Published 5 years ago

kolpak0860-register-form v2.0.0

Weekly downloads
-
License
-
Repository
-
Last release
5 years ago

RegisterForm

This library was generated with Angular CLI version 8.2.14.

Code scaffolding

Run ng generate component component-name --project register-form to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project register-form.

Note: Don't forget to add --project register-form or else it will be added to the default project in your angular.json file.

Build

Run ng build register-form to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build register-form, go to the dist folder cd dist/register-form and run npm publish.

Running unit tests

Run ng test register-form to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

Description

The form was implemented using custom value accessor NG_VALUE_ACCESSOR and NG_VALIDATORS

The registration form contains the following fields: firstName: '', Validators.required, lastName: '', Validators.required, amount: ['', Validators.required, Validators.min(20)], country: '', Validators.required

Getting started

At app.module.ts:

import { RegisterFormModule } from 'kolpak0860-register-form';

@NgModule({
    imports: [RegisterFormModule],
})

In component.html:

<form [formGroup]="signupForm" (ngSubmit)="onSubmit()">
    <lib-register-form formControlName="register"></lib-register-form>
    <div class="form-group">
        <button (click)="onSubmit()" class="btn btn-primary">Register</button>
        <a routerLink="/login" class="btn btn-link">Cancel</a>
    </div>
</form>

In component.ts: this.signupForm = this.fb.group({ register: [], });

1.1.1

5 years ago

2.0.0

5 years ago

1.1.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago