I have the following constant defined in one of my models.
export const NEWS_TYPE_TEXT = {
News: 'News',
Interview: 'Interview',
Digest: 'Digest',
CompanyAnalysis: 'Company Analysis',
};
Usually I would pass the whole constant to the component, i.e.:
<mb-simple-select [options]="NEWS_TYPE_TEXT"> </mb-simple-select>
But now I need to pass only a subset of these values. (For example, only 'News' and 'Digest').
I have tried the following, which does not work:
<simple-select [options]="NEWS_TYPE_TEXT.News, NEWS_TYPE_TEXT.Digest"></simple-select>
Then I tried the following. This works, but passes the values as an array, and only the actual text values, without the keys:
<simple-select [options]="[NEWS_TYPE_TEXT.News, NEWS_TYPE_TEXT.Digest]"></simple-select>
Is there an elegant way to pass this subset of values to a component so that they preserve their object key:value structure?
Thanks in advance.