Skip to content

Instantly share code, notes, and snippets.

@LeoNero
Created August 13, 2016 22:33
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 LeoNero/549bf036f0af76b45814b388b282f60b to your computer and use it in GitHub Desktop.
Save LeoNero/549bf036f0af76b45814b388b282f60b to your computer and use it in GitHub Desktop.
import {inject} from 'aurelia-framework';
import {HttpClient} from 'aurelia-fetch-client';
@inject(HttpClient)
export class NewTask {
tasksType =
[
{number: 1, type: 'Personal Preference'},
{number: 2, type: 'Paired Choice'},
{number: 3, type: 'Announcement/Discussion'},
{number: 4, type: 'General/Specific'},
{number: 5, type: 'Problem/Solution'},
{number: 6, type: 'Summary'}
];
tasks = [];
url = 'tasks/';
constructor(http) {
this.http = http;
this.selectedTask = null;
this.selectedTaskType = null;
}
onChangeTaskType() {
this.http.fetch(this.url + this.selectedTaskType.number)
.then(response => response.json())
.then(t => this.tasks = t);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment