JMIII
JMIII

Reputation: 404

How to pass ngrx signal store as a required input to a component

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.

Upvotes: 0

Views: 36

Answers (1)

JMIII
JMIII

Reputation: 404

Figured it out. Have to use InstanceType

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

Upvotes: 0

Related Questions