I suspect I have made a mistake, but I can't get the following to pass type checking. I end up with Property 'map' does not exist for type 'Restos'. I have set up the interface according to the TS tutorials, so it feels as though map is not included as default (I have "target": "es6" in tsconfig)
interface Resto {
rname:String,
qname:String,
tel:String
}
interface Restos {
[index:number]:Resto;
}
class MainController {
headline: String;
rnames: [String];
constructor($http : ng.IHttpService) {
this.headline = "hello world";
$http.get('http://afbackend.herokuapp.com/api/restos')
.success( (res:Restos) => {
console.log(res);
this.rnames = res.map(r => r.rname)
^^^
});
}
}