SHARE
TWEET

Untitled

a guest May 23rd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. interface EnumServiceItem {
  2.     id: number; label: string; key: any
  3. }
  4.  
  5. interface EnumServiceItems extends Array<EnumServiceItem>{}
  6.  
  7.  
  8. // Option A
  9. var result: EnumServiceItem[] = [
  10.     { id: 0, label: 'CId', key: 'contentId' },
  11.     { id: 1, label: 'Modified By', key: 'modifiedBy' },
  12.     { id: 2, label: 'Modified Date', key: 'modified' },
  13.     { id: 3, label: 'Status', key: 'contentStatusId' },
  14.     { id: 4, label: 'Status > Type', key: ['contentStatusId', 'contentTypeId'] },
  15.     { id: 5, label: 'Title', key: 'title' },
  16.     { id: 6, label: 'Type', key: 'contentTypeId' },
  17.     { id: 7, label: 'Type > Status', key: ['contentTypeId', 'contentStatusId'] }
  18. ];
  19.  
  20. // Option B
  21. var result: EnumServiceItems = [
  22.     { id: 0, label: 'CId', key: 'contentId' },
  23.     { id: 1, label: 'Modified By', key: 'modifiedBy' },
  24.     { id: 2, label: 'Modified Date', key: 'modified' },
  25.     { id: 3, label: 'Status', key: 'contentStatusId' },
  26.     { id: 4, label: 'Status > Type', key: ['contentStatusId', 'contentTypeId'] },
  27.     { id: 5, label: 'Title', key: 'title' },
  28.     { id: 6, label: 'Type', key: 'contentTypeId' },
  29.     { id: 7, label: 'Type > Status', key: ['contentTypeId', 'contentStatusId'] }
  30. ]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top