Guest User

Untitled

a guest
Jul 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. class BaseClass {
  2. constructor(cfg) {
  3.  
  4. // Transfer all properties to class object
  5. Object.assign(this, cfg);
  6.  
  7. if(this.el instanceof HTMLElement === false) {
  8. return;
  9. }
  10. this.setup();
  11. }
  12.  
  13. setup() {
  14. this.isSetup = true;
  15. }
  16.  
  17. class MyClass extends BaseClass {
  18. setup() {
  19. // Calling super
  20. super.setup();
  21.  
  22. this.show(); **// this.show is not a function**
  23. }
  24. show = () => {
  25. console.log('called');
  26. }
  27. }
Add Comment
Please, Sign In to add comment