this used to work just fine in TS 2.3
getCampaigns(): Observable<List<CampaignsModelExt>> {
return this.store.select(store => store.msDatabase.sdk.table_campaigns)
.take(1)
}
but with 2.4 I get an error of:
Error:(628, 9) TS2322:Type 'Observable>' is not assignable to type 'Observable>'. Type 'List' is not assignable to type 'List'. Type 'CampaignsModel' is not assignable to type 'CampaignsModelExt'. Property 'getCampaignPlaylistModeName' is missing in type 'CampaignsModel'.
so in order to fix it I have to cast it now: as Observable<List<CampaignsModelExt>>;
getCampaigns(): Observable<List<CampaignsModelExt>> {
return this.store.select(store => store.msDatabase.sdk.table_campaigns)
.take(1) as Observable<List<CampaignsModelExt>>;
}
any ideas why?
and if you are wondering about my store.msDatabase.sdk.table_campaigns
its typed as table_campaigns?: List<CampaignsModel>;
Thanks you,
Sean
>` you would not have the problem. A `CampaignsModel` is not necessarily a `CampaignsModelExt` and that is now checked in the generics and is an error.
– cartant Jul 17 '17 at 17:53