I have some questions about typescript/javascript inheritance. I have the following base class (express controller router):
abstract class BaseCtrl {
abstract model;
// Get all
getAll = (req, res) => {
this.model.find({}, (err, docs) => {
if (err) { return console.error(err); }
res.json(docs);
});
};
export default BaseCtrl;
And the following class that implements that base:
import BaseCtrl from './base';
import Card from '../models/card';
export default class CardCtrl extends BaseCtrl {
model = Card;
getAll = (req, res) => {
super.getAll(req, res);
}
}
This code gives me the error:
Only public and protected methods of the base class are accessible via the super keyword
I would like to know how to call the super method. Can anyone help me?