Type-checking the response
.subscribe((data: Config) => this.config = {
title: data['title'],
body: data['body']
});export interface Config {
title: string;
body: string;
}getConfig() {
// now returns an Observable of Config
return elixor.get<Config[]>(this.configUrl);
}Last updated