byłem po tej próbki z https://angular.io/docs/ts/latest/guide/router.htmlts1109: ekspresja oczekiwać błędu kątowego
i staram się zrobić podobną listę z usługi, jak również, ale z jakiegoś powodu, gdy piszę ten wiersz
servingpatients = Patient[];
w moim komponencie dostaję ten błąd, jeśli go usunę, to działa. Nie jestem pewien, co to jednak próbuje zrobić w próbce. Błąd konsola: error
Uncaught SyntaxError: Unexpected token ]
terminala podczas typów kompilacji
app/dashboard/dashboard.component.ts(35,27):error TS1109: Expression expected
dashboard.component.ts
import {Component, OnInit} from 'angular2/core';
import {Patient, DashboardService} from './dashboard.service';
import {Router} from 'angular2/router';
export class DashboardComponent implements OnInit{
servingpatients = Patient[];
constructor(private _service : DashboardService,
private _router: Router){}
ngOnInit(){
this._service.getServingPatients().then(servingpatients => this.servingpatients = servingpatients)
}
}
Tak, że był problem, DIN nie zauważaj tego. Dzięki. –