An open API service indexing awesome lists of open source software.

https://github.com/billcheng/ng-form-group

Node.js Form Validation (Angular style)
https://github.com/billcheng/ng-form-group

angular nodejs server-side validator

Last synced: 2 months ago
JSON representation

Node.js Form Validation (Angular style)

Awesome Lists containing this project

README

          

# nodejs-ng-form
Similar to Angular Reactive Form "API" but on the server side.

# How To Install
```bash
npm i nodejs-ng-form
```
or
```bash
yarn nodejs-ng-form
```

# Example
```javascript
import { formBuilder } from 'nodejs-ng-form'

function validate(name, address, city, zipcode) {
const form = formBuilder.group({
name: [name, Validators.required],
address: [address, Validators.required],
city: [city, Validators.required],
zipcode: [zipcode,
Validators.compose([
Validators.required,
Validators.pattern(/\d{5}/)
])
]
})

return form.valid
}
```