Skip to content

Instantly share code, notes, and snippets.

@ccsilveira
Created September 29, 2017 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccsilveira/4991552909afc2f8284355c4a1dd929b to your computer and use it in GitHub Desktop.
Save ccsilveira/4991552909afc2f8284355c4a1dd929b to your computer and use it in GitHub Desktop.
Figuring out how to get params from activate hook on aurelia
import {bindable, inject, NewInstance} from 'aurelia-framework';
import {HttpClient, json} from 'aurelia-fetch-client';
import {Router} from 'aurelia-router';
@inject(NewInstance.of(HttpClient))
export class Sprint {
tbColaborador;
constructor(http, sprintId) {
this.http = http;
this.getList();
}
attached() {
}
activate(item) {
item = item.id;
}
getList(item) {
return this.http.fetch('http://10.1.70.103:3536/metricas/sprints/' + item)
.then(response => response.json())
.then(data => {
console.log(data);
this.tbColaborador = data;
})
}
}
@ccsilveira
Copy link
Author

Add routerParams variable

@ccsilveira
Copy link
Author

change item to params

@ccsilveira
Copy link
Author

this.routerParams = params; ???

@ccsilveira
Copy link
Author

retrieve id value from this.routerParams.id;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment