We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm confused because the docs have Typescript and ES5 syntax, but I generally write ES6.
I can't figure out how to instantiate my models with ES6. I'd really rather not write TS.
This works:
const ApplicationRecord = SpraypaintBase.extend( { static: { baseUrl: window.location.origin, apiNamespace: "/api" } } ) const Tag = ApplicationRecord.extend( { static: { jsonapiType: "tags" }, attrs: { name: attr(), }, methods: { sayHi: function() { return `Hi I'm a ${this.name} tag` } } } )
But I'd prefer to write something like this, thought I'm not sure how to define attributes etc... Please help...
export default class ApplicationRecord extends SpraypaintBase { static baseUrl = window.location.origin static apiNamespace = "/api" } export default class Tag extends ApplicationRecord { static jsonapiType = "tags" //attributes ... etc sayHi() { return `Hi I'm a ${this.name} tag` } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm confused because the docs have Typescript and ES5 syntax, but I generally write ES6.
I can't figure out how to instantiate my models with ES6. I'd really rather not write TS.
This works:
But I'd prefer to write something like this, thought I'm not sure how to define attributes etc... Please help...
The text was updated successfully, but these errors were encountered: