hey everyone! I am building a simple class
, and when trying to access this
inside a static
method like this:
const { ProductsCollection } = require('../utils/Collection')
let modeledCollection = ProductsCollection.mapToModel(legacy)
I get that this.generateModel is not a function
. Here is my class:
class ProductsCollection {
constructor () {
generateModel () {
let model = { name: 'testing' }
return model
}
static mapToModel (legacy) {
if (!isObject(legacy))
return legacy
let current = this.generateModel() // Here!!!
for (let key in legacy) {
// some code...
}
return current
}
}
module.exports = { ProductsCollection }
any idea why?
prevent()
function in my Login
component from my LoginPage
component's onSubmit
function
position: absolute
?
@media
queries here and there