MCPcopy Index your code
hub / github.com/SamVerschueren/ngx-ow

github.com/SamVerschueren/ngx-ow @v0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.0 ↗ · + Follow
2 symbols 9 edges 3 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ngx-ow Build Status

Angular form validation on steroids

Use Ow to easily validate your Angular forms.

Install

$ npm install ow ngx-ow

Usage

Ow API documentation - Example

import {Component, OnInit} from '@angular/core';
import {owValidator} from 'ngx-ow';
import ow from 'ow';

@Component({
    selector: 'sign-up',
    templateUrl: 'sign-up.component.html'
})
export class SignUpComponent implements OnInit {
    form: FormGroup;

    constructor(
        private formBuilder: FormBuilder
    ) {}

    ngOnInit() {
        this.form = this.formBuilder.group({
            firstName: ['', owValidator('firstNameRequired', ow.string.nonEmpty)],
            name: ['', owValidator('nameRequired', ow.string.nonEmpty)],
            email: ['', owValidator('emailInvalid', ow.string.nonEmpty.includes('@'))],
            password: ['', owValidator('passwordInvalid', ow.string.minLength(6))]
        });
    }
}

If someone enters an invalid email address, the errors object for the email control will look like this.

{
    "emailInvalid": "Expected string to include `@`, got `hello`"
}

Related

  • ow - Function argument validation for humans.

License

MIT © Sam Verschueren

Core symbols most depended-on inside this repo

owValidator
called by 5
source/ow.validator.ts
getErrors
called by 4
source/test.ts

Shape

Function 2

Languages

TypeScript100%

Modules by API surface

source/test.ts1 symbols
source/ow.validator.ts1 symbols

For agents

$ claude mcp add ngx-ow \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page