Skip to content

decorators for validations #523

@iuribrindeiro

Description

@iuribrindeiro

Well, I'm currently working on decorators for aurelia validation.
At the moment, I have the following code working:

export class ClientViewModel {
  public Id: string;

  @required()
  public Name: string;

  @displayName("Identity")
  @email("It's not an valid email")
  @satisfiesRule("cpfcnpj")
  @required()
  public PersonIdentity: string;

  constructor(data: any = {}) {
    this.Id = data.Id || null;
    this.Name = data.Name || null;
    this.PersonIdentity = data.PersonIdentity || null;
  }
}

After I'm done, would you guys be interested in accept a PR?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions