Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Martin cmartin81

  • Transponder / Martin Consulting
  • Hvalstad
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am cmartin81 on github.
  • I am cmartin81 (https://keybase.io/cmartin81) on keybase.
  • I have a public key ASDO8-shjkz76vJuWOmCUEWjf5nufdFILePgorpfelBY8Qo

To claim this, I am signing this object:

@cmartin81
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(win.location.host)
}
logOrigin(){
console.log(this.$window.origin); //all the injected values will be auto injected to the class under this.<injected object>