Skip to content

hadrienl/aurelia-inject-property

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Inject a dependency directly as a property. Instead of using @inject, then set the property in the constructor, you can only use this decorator:

Exemple:

@import {injectPropery} from 'aurelia-inject-property';
@import {MyService} from 'my-service';

class MyView {
  @injectProperty(MyService} myService;

  attached() {
    this.thing = this.myService.getThing();
  }
}

About

Inject a dependency as a property

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published