lundi 29 juin 2015

Object with one key as default (getter/setter)


I know with all the new ECMAScript6 stuff we're having some amazing things happening. My goal was to do something like this I don't know if its possible:

var angEl = {
  get(): blah,
  scope: this.scope(),
  injector: this.injector()
}

Right now I do it like this:

var angEl = blah;
var angElProps = {
  scope: angEl.scope(),
  injector: angEl.injector()
}

Just wondering if there is any cool new hip way to accheive this.


Aucun commentaire:

Enregistrer un commentaire