stavo seguendo questo campione da https://angular.io/docs/ts/latest/guide/router.htmlts1109: espressione di errore angolare previsto
e io sto cercando di fare una lista simile con un servizio pure, ma qualche ragione quando scrivo questa linea
servingpatients = Patient[];
nel mio componente, sto ricevendo questo errore, se lo rimuovo, la cosa funziona. Non sono sicuro che cosa stia cercando di fare nell'esempio. Errore di console: errore
Uncaught SyntaxError: Unexpected token ]
terminale durante la compilazione tipi
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)
}
}
Sì che era il problema, din non me ne accorgo. Grazie. –