18.0.0 • Published 12 months ago
@ismaestro/ngx-scroll-to-first-invalid v18.0.0
Table of contents
Usage
npm i @ismaestro/ngx-scroll-to-first-invalid --save-dev1. Import the directive in your component:
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
standalone: true,
imports: [NgxScrollToFirstInvalidDirective, ...],
changeDetection: ChangeDetectionStrategy.OnPush,
})2. Use the directive inside a form:
<form [formGroup]="testForm" ngxScrollToFirstInvalid>
<input id="test-input1" type="text" formControlName="someText1" />
<button (click)="saveForm()"></button>
</form>Here you have an example of a form using ngx-scroll-to-first-invalid. DEMO
It also works with nested forms, and recently added support for Angular Ionic.
Bugs and feature requests
Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.
Creators
Ismael Ramos
Copyright and license
Code released under the MIT License.
Enjoy :metal: