最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to pass ngrx signal store as a required input to a component - Stack Overflow

programmeradmin1浏览0评论

The below code works on a component to pass an ngrx signal store as a parameter to the component.

listingAddInfoStore = input(inject(ListingAddInfoStore));

I want to make it a required parameter like so

listingAddInfoStore = input.requried<>()

The issue I am running into is the type for input required. I have tried

listingAddInfoStore = input.required<ListingAddInfoStore>()

and

listingAddInfoStore = input.required<typeof ListingAddInfoStore>()

with no luck.

The below code works on a component to pass an ngrx signal store as a parameter to the component.

listingAddInfoStore = input(inject(ListingAddInfoStore));

I want to make it a required parameter like so

listingAddInfoStore = input.requried<>()

The issue I am running into is the type for input required. I have tried

listingAddInfoStore = input.required<ListingAddInfoStore>()

and

listingAddInfoStore = input.required<typeof ListingAddInfoStore>()

with no luck.

Share Improve this question asked Feb 1 at 11:51 JMIIIJMIII 4043 silver badges17 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Figured it out. Have to use InstanceType

listingAddInfoStore = input.required<InstanceType<typeof ListingAddInfoStore>>();

发布评论

评论列表(0)

  1. 暂无评论