This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @Component({ | |
| selector: 'app', | |
| template: ` | |
| <h1>Angular's content projection and lifecycle example</h1> | |
| <app-content> | |
| <app-nested-component></app-nested-component> | |
| </app-content> | |
| `, | |
| }) | |
| export class App {} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @Component({ | |
| selector: 'app', | |
| template: ` | |
| <app-tabs> | |
| <app-tab name="First" [templateRef]="firstRef"></app-tab> | |
| <app-tab name="Second" [templateRef]="secondRef"></app-tab> | |
| <app-tab name="Third" [templateRef]="thirdRef"></app-tab> | |
| </app-tabs> | |
| <template #firstRef> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @Component({ | |
| selector: 'app-tab', | |
| template: '', | |
| }) | |
| export class TabComponent { | |
| @Input() name: string; | |
| @Input() templateRef: TemplateRef; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @Component({ | |
| selector: 'app-tabs', | |
| template: ``, | |
| }) | |
| export class TabsComponent implements AfterContentInit { | |
| @ContentChildren(TabComponent) tabList: QueryList<TabComponent>; | |
| currentTab: TabComponent; | |
| ngAfterContentInit() { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | span { | |
| float: left; | |
| padding: 5px; | |
| background-color: #D0CCD0; | |
| border-radius: 5px 5px 0 0; | |
| color: #828181; | |
| font-size: 14px; | |
| cursor: pointer; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | onTabClick(tab: TabComponent) { | |
| this.currentTab = tab; | |
| } | |
| isSelected(tab: TabComponent) { | |
| return this.currentTab.name === tab.name; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function retryablePromise(retries) { | |
| return new Promise((resolve, reject) => { | |
| reject(); | |
| }) | |
| .catch(() => { | |
| if (retries > 0) { | |
| return retryablePromise(retries - 1); | |
| } else { | |
| return Promise.reject(); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Example implementation of simple Arena Allocator and simple Object Pool that works with C99 and C++ compilers. | |
| // | |
| // Check the bottom of the file to see the license. | |
| // | |
| // Enjoy! | |
| #include <stdio.h> | |
| #include <malloc.h> | |
| #include <string.h> |