The compiler does not know whether the property is present seriesin this.optionsas you type it as Object.
To overcome this, you can either remove the typing for the property (lazy output):
class AppComponent {
options: any;
}
, , this.options :
class AppComponent {
options = {
chart: {
zoomType: 'xy'
},
series: ...
// ...
};
}
options :
interface Options {
series: any[],
}
class AppComponent {
options: Options;
constructor() {
this.options = {
chart: {
zoomType: 'xy'
},
series: ...
};
}
}