Created
August 7, 2017 10:00
-
-
Save davismj/2272855ab3f5a9ab5472eebe36e05e50 to your computer and use it in GitHub Desktop.
di vs no di
This file contains hidden or 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
| export class MyViewModel { | |
| // this is what the @inject(Element) decorator does to the MyViewModel class under the hood. | |
| static inject = [Element]; | |
| constructor(element) { | |
| this.el = element; | |
| } | |
| } |
This file contains hidden or 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
| export class MyViewModel { | |
| constructor() { | |
| this.el = document.getElementById('my-element'); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment