Created
April 25, 2016 06:43
-
-
Save vaskokj/8a4e3d10d5a514aaef16f6594ec08052 to your computer and use it in GitHub Desktop.
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 {inject, bindable} from 'aurelia-framework'; | |
import {HttpClient} from 'aurelia-fetch-client'; | |
import 'fetch'; | |
@inject(HttpClient) | |
export class Doc{ | |
@bindable designGroupData = '' | |
constructor(http) { | |
http.configure(config => { | |
config | |
.useStandardConfiguration() | |
.withBaseUrl('http://localhost:8080/'); | |
}); | |
this.http = http; | |
} | |
test(selectedDgs) { | |
//if I uncomment this designGroupDataChanged() will fire. Data is coming back correctly from REST API based on console.log(data) | |
//this.http.fetch('./data).then(response => response.json()).then(data => this.designGroupData = console.log(data)); | |
return this.http.fetch('.data).then(response => response.json()).then(data => this.designGroupData = data); | |
} | |
designGroupDataChanged() { | |
console.log('data change detected - updating table'); | |
console.log('Test: ' + this.designGroupData) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment