Advertisement
Guest User

Untitled

a guest
Aug 16th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1.  
  2. @CustomComponent({
  3. selector: 'app-session-pool-list',
  4. parent: BasePageSectionComponent,
  5. template: (parentTemplate) => {
  6. return `
  7. ${parentTemplate}
  8. <ng-template #sectionContentTemplate let-type>
  9. <div>
  10. <button
  11. type="button"
  12. class="btn btn-default"
  13. (click)="createNewPool()">Create New Pool</button>
  14. </div>
  15. <div class="table-head-row table-row col-sm-12">
  16. <app-table-head
  17. [title]="'Description'"
  18. ></app-table-head>
  19. <app-table-head
  20. [title]="'State'"
  21. ></app-table-head>
  22. <app-table-head
  23. [title]="'# Of Sessions'"
  24. ></app-table-head>
  25. </div>
  26. <div class="table-content-row table-row col-sm-12">
  27. <div
  28. *ngFor="let session of sessionPool; let i = index">
  29. <app-table-cell
  30. [content]="session.description"
  31. ></app-table-cell>
  32. <app-table-cell
  33. [content]="session.state"
  34. ></app-table-cell>
  35. <app-table-cell
  36. [content]="i"
  37. ></app-table-cell>
  38. </div>
  39. </div>
  40. </ng-template>
  41. `;
  42. }
  43. })
  44.  
  45. export class SessionPoolListComponent extends BasePageSectionComponent implements OnInit {
  46. private sessionPool;
  47. constructor(
  48. private injector: Injector,
  49. private sessionsService: SessionRecorderService
  50. ) {
  51. super();
  52. }
  53.  
  54. ngOnInit() {
  55. super.inject(this.injector);
  56. this.sessionsService.fetchAll().then((res) => {
  57. this.sessionPool = res;
  58. });
  59. }
  60.  
  61. createNewPool(event: Event) {
  62. event.preventDefault();
  63. event.stopImmediatePropagation();
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement