argument
argument copied to clipboard
How to validate models?
When having some component which takes some model as an argument, how can I validate it?
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;
}
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