Skip to content

Instantly share code, notes, and snippets.

@hakant
Last active April 5, 2016 19:06
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 hakant/6ab1a376f50b80bd115f765e16a551f4 to your computer and use it in GitHub Desktop.
Save hakant/6ab1a376f50b80bd115f765e16a551f4 to your computer and use it in GitHub Desktop.
import {inject} from 'aurelia-framework';
import {computedFrom} from 'aurelia-framework';
import {ApplicationState} from './infrastructure/application-state';
@inject(ApplicationState)
export class Overview {
_projects = [];
constructor(state) {
state.getProjects()
.then(p => this._projects = p);
}
@computedFrom('_projects')
get projects() {
return this._projects;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment