Last active
October 20, 2020 16:40
-
-
Save adrienpoly/de2b3cbb1b24ba9fb07bb60a60892719 to your computer and use it in GitHub Desktop.
accessing static values from a class instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A extends Controller { | |
static targets = ["a", "b"] | |
connect() { | |
A.targets // -> ["a", "b"] | |
} | |
} | |
export default class extends Controller { | |
static targets = ["a", "b"] | |
connect() { | |
this.constructor.targets // -> ["a", "b"] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🥳