Last active
August 29, 2015 14:18
-
-
Save plwalters/75e373f7942cdd319817 to your computer and use it in GitHub Desktop.
using Dependency injection to inject shared state singleton module aurelia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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