argument icon indicating copy to clipboard operation
argument copied to clipboard

How to validate models?

Open artemgurzhii opened this issue 5 years ago • 2 comments

When having some component which takes some model as an argument, how can I validate it?

artemgurzhii avatar Mar 29 '19 20:03 artemgurzhii

Looking at the documentation I think you can do something like

import Model from '@ember-data/model';

export default class MyComponent extends Component {
  @argument(Model) entity;
}

VincentMolinie avatar May 20 '20 06:05 VincentMolinie

For the record, I don't think this addon is really maintained anymore.

I would recommend checking out ember-arg-types, the spiritual successor to this package!

https://github.com/jkusa/ember-arg-types

alexlafroscia avatar May 20 '20 15:05 alexlafroscia