Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface EnumServiceItem {
- id: number; label: string; key: any
- }
- interface EnumServiceItems extends Array<EnumServiceItem>{}
- // Option A
- var result: EnumServiceItem[] = [
- { id: 0, label: 'CId', key: 'contentId' },
- { id: 1, label: 'Modified By', key: 'modifiedBy' },
- { id: 2, label: 'Modified Date', key: 'modified' },
- { id: 3, label: 'Status', key: 'contentStatusId' },
- { id: 4, label: 'Status > Type', key: ['contentStatusId', 'contentTypeId'] },
- { id: 5, label: 'Title', key: 'title' },
- { id: 6, label: 'Type', key: 'contentTypeId' },
- { id: 7, label: 'Type > Status', key: ['contentTypeId', 'contentStatusId'] }
- ];
- // Option B
- var result: EnumServiceItems = [
- { id: 0, label: 'CId', key: 'contentId' },
- { id: 1, label: 'Modified By', key: 'modifiedBy' },
- { id: 2, label: 'Modified Date', key: 'modified' },
- { id: 3, label: 'Status', key: 'contentStatusId' },
- { id: 4, label: 'Status > Type', key: ['contentStatusId', 'contentTypeId'] },
- { id: 5, label: 'Title', key: 'title' },
- { id: 6, label: 'Type', key: 'contentTypeId' },
- { id: 7, label: 'Type > Status', key: ['contentTypeId', 'contentStatusId'] }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement