testpromise():any{
console.log('json called');
return new Promise(resolve => {
this.http.get('assets/list.json').map((response) => {
resolve(response.json());
});
});
}
ngOnInit() {
this.assignmentsService.testpromise().then(
result => {
alert("Fulfilled: " + result);
},
error => {
alert("Rejected: " + error);
}
);
this.assignments = this.assignmentsService.getAssignments()
.slice(0, 5)
.map(x => new AssignmentView(x));
}