Skip to content

Instantly share code, notes, and snippets.

@vaskokj
Created April 25, 2016 06:43
Show Gist options
  • Save vaskokj/8a4e3d10d5a514aaef16f6594ec08052 to your computer and use it in GitHub Desktop.
Save vaskokj/8a4e3d10d5a514aaef16f6594ec08052 to your computer and use it in GitHub Desktop.
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