Validators

Validators

Stable Class

Class Overview

class Validators {
  static required(control: AbstractControl) : ValidationErrors|
}

Class Description

Provides a set of validators used by form controls.

A validator is a function that processes a FormControl or collection of controls and returns a map of errors. A null map means that validation has passed.

Example

var loginControl = new FormControl("", Validators.required)

Static Members

required(control: AbstractControl) : ValidationErrors|

Validator that requires controls to have a non-empty value.

exported from forms-index, defined in forms/src/validators.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/docs/ts/latest/api/forms/index/Validators-class.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部