Skip to content

Running ember-cp-validations using typescript #702

Open
@gabrieltrita

Description

@gabrieltrita

Environment

  • Ember Version: 3.20.2
  • Ember CLI Version: 3.20.2
  • Ember CP Validations Version: 4.0.0-beta.10
  • Typescript: 4.5.4

Steps to Reproduce

Hello everyone! I'm using native class in my project and we're migrating to Typescript. We have models like this in the current project:

const Validations = buildValidations({
  name: [
    validator('presence', true),
  ]
});

export default class UserModel extends Model.extend(Validations) {
...
}

when changing to typescript the Model.extend(Validations) stops working. Does anyone have an alternative? I've seen decorators like hasValidations implemented in the past, but it's been removed. I wanted to know if we have any alternative for the typescript. Thanks!

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