Skip to content

Instantly share code, notes, and snippets.


Christian Martin cmartin81

  • Transponder / Martin Consulting
  • Hvalstad
View GitHub Profile

Keybase proof

I hereby claim:

  • I am cmartin81 on github.
  • I am cmartin81 ( on keybase.
  • I have a public key ASDO8-shjkz76vJuWOmCUEWjf5nufdFILePgorpfelBY8Qo

To claim this, I am signing this object:

cmartin81 / gist:42c713be3034ead79799
Created Jul 28, 2015
How to use ng-decorator module
View gist:42c713be3034ead79799
import {Factory, Directive, Provider, Service, Controller} from 'ng-decorators'
@Factory(['$window']) //or Directive or Provider or Service or Controller
class FooBar{
constructor(win){ //if you need to access the injected object it will be passed into the constructor
console.log(this.$window.origin); //all the injected values will be auto injected to the class under this.<injected object>