Upon enabling the Angular compiler optionstrictTemplates: true in my code base, I noticed that all of the directive @Input()s are typed as non-nullable. With that rule enabled, the following bit of code is no longer valid:
error TS2322: Type 'EChartsOption | null' is not assignable to type 'EChartsOption'.
Type 'null' is not assignable to type 'EChartsOption'.
I checked the directive implementation and it appears that all @Inputs are already treated as nullable, but just not typed as such. Would it be possible to change that, such that we get something like:
Upon enabling the Angular compiler option
strictTemplates: true
in my code base, I noticed that all of the directive@Input()
s are typed as non-nullable. With that rule enabled, the following bit of code is no longer valid:I checked the directive implementation and it appears that all
@Input
s are already treated as nullable, but just not typed as such. Would it be possible to change that, such that we get something like:Currently, I have to make use of
$any
to get past the compilation error, which is not ideal:An alternative would be to add an
*ngIf
:But I do not want to do this, since that would unnecessarily delay the initialisation of echarts on the element.
Thanks a lot for maintaining this library. Hoping to hear your thoughts!
N.B. I personally would only need
options
&merge
to be nullable, but I think it makes sense for all other options as well.