Skip to content

Instantly share code, notes, and snippets.

@plwalters
Last active August 29, 2015 14:18
Show Gist options
  • Save plwalters/75e373f7942cdd319817 to your computer and use it in GitHub Desktop.
Save plwalters/75e373f7942cdd319817 to your computer and use it in GitHub Desktop.
using Dependency injection to inject shared state singleton module aurelia
import {Configuration} from './configuration';
import {HttpClient} from 'aurelia-http-client';
import {inject} from 'aurelia-framework';
@inject(Configuration, HttpClient)
export class DataAccessor {
constructor(config, http){
this.path = config.baseUri + 'users/pwkad';
this.http = http;
this.getUser();
}
getUser(){
return this.http.get(this.path)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment