df-merge-validation-errors

WebJar for df-merge-validation-errors

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.bower
Идентификатор

Идентификатор

df-merge-validation-errors
Последняя версия

Последняя версия

0.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

df-merge-validation-errors
WebJar for df-merge-validation-errors
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/digitalfondue/df-merge-validation-errors

Скачать df-merge-validation-errors

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.bower/df-merge-validation-errors/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>df-merge-validation-errors</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/df-merge-validation-errors/
implementation 'org.webjars.bower:df-merge-validation-errors:0.1.1'
// https://jarcasting.com/artifacts/org.webjars.bower/df-merge-validation-errors/
implementation ("org.webjars.bower:df-merge-validation-errors:0.1.1")
'org.webjars.bower:df-merge-validation-errors:jar:0.1.1'
<dependency org="org.webjars.bower" name="df-merge-validation-errors" rev="0.1.1">
  <artifact name="df-merge-validation-errors" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='df-merge-validation-errors', version='0.1.1')
)
libraryDependencies += "org.webjars.bower" % "df-merge-validation-errors" % "0.1.1"
[org.webjars.bower/df-merge-validation-errors "0.1.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.bower : angular jar [1.4.0,)

Модули Проекта

Данный проект не имеет модулей.

df-merge-validation-errors

A small angular directive for merging validation errors (e.g.: server side validations) to a form.

df-merge-validation-errors update the validation state of each field in a form accordingly to the watched object.

Download

Requirements

AngularJS (tested with 1.4.0) and the ngMessages module.

Use/examples

Load the dfMergeValidationErrors module and apply the directive df-merge-validation-errors="your_object_to_watch" to a form.

The "your_object_to_watch" should have the following form:

{ <fieldKey> : {type: string, message: string} | [{type: string, message}] | [string] | string}

For example:

{
  'email' : {type: 'already_used', message : 'Email already used'}, /* single object*/
  'name' : [{type: 'too_long', message : 'Name is too long'}, {type: 'invalid_chars', message : 'Contain invalid characters'}] /* multiple errors */,
  'repeat-email' : ['error.key1', 'error.key2'],
  'repeat-name': 'error.key1'
}

Note:

  • the error type will have all the white space replaced with a '-'. For example if you provide {'email': 'my error message'}, the error type will be my-error-message.
  • when you provide an error message not in a list (e.g.: {'email': 'my-error'}), you should not use a ng-repeat for iterating on the error message of the specific field.

See the examples in example/index.html or directly http://digitalfondue.github.io/df-merge-validation-errors/

org.webjars.bower

Версии библиотеки

Версия
0.1.1