Skip to content

Instantly share code, notes, and snippets.

@davismj
Created August 7, 2017 10:00
Show Gist options
  • Select an option

  • Save davismj/2272855ab3f5a9ab5472eebe36e05e50 to your computer and use it in GitHub Desktop.

Select an option

Save davismj/2272855ab3f5a9ab5472eebe36e05e50 to your computer and use it in GitHub Desktop.
di vs no di
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;
}
}
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