Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. <table class="calendar">
  2. <thead>
  3. <tr>
  4. <th class="day-of-week">Monday</th>
  5. <th class="day-of-week">Tuesday</th>
  6. <th class="day-of-week">Wednesday</th>
  7. <th class="day-of-week">Thursday</th>
  8. <th class="day-of-week">Friday</th>
  9. <th class="day-of-week">Saturday</th>
  10. <th class="day-of-week">Sunday</th>
  11. </tr>
  12. </thead>
  13. <tbody>
  14. <tr *ngFor="let week of weeks">
  15. <td *ngFor="let day of week" class="day-of-month">
  16. <div class="events">
  17. <span class="day-number">{{ day | date:'d' }}</span>
  18. </div>
  19. </td>
  20. </tr>
  21. </tbody>
  22.  
  23. <ng-template #content let-modal>
  24. <div class="modal-header">
  25. <button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
  26. <span aria-hidden="true">&times;</span>
  27. </button>
  28. </div>
  29. <div class="modal-body">
  30. <form>
  31. <div class="form-group">
  32. <label for="event">Write your event here</label>
  33. <div class="input-group">
  34. <input id="event" class="form-control" placeholder="Description">
  35. </div>
  36. </div>
  37. </form>
  38. </div>
  39. <div class="modal-footer">
  40. <button type="button" class="btn btn-outline-dark" (click)="modal.close('Save click')">Save</button>
  41. </div>
  42. </ng-template>
  43.  
  44. <button type="button" (click)="open(content)">Add event</button>
  45.  
  46. import {Component} from '@angular/core';
  47.  
  48. import {NgbModal, ModalDismissReasons} from '@ng-bootstrap/ng-bootstrap';
  49.  
  50. @Component({
  51. selector: 'ngbd-modal-basic',
  52. templateUrl: './modal.component.html'
  53. })
  54. export class NgbdModalBasic {
  55. closeResult: string;
  56.  
  57. constructor(private modalService: NgbModal) {}
  58.  
  59. open(content) {
  60. this.modalService.open(content, {ariaLabelledBy: 'modal-title'}).result.then((result) => {
  61. this.closeResult = `Closed with: ${result}`;
  62. }, (reason) => {
  63. this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
  64. });
  65. }
  66.  
  67. private getDismissReason(reason: any): string {
  68. if (reason === ModalDismissReasons.ESC) {
  69. return 'by pressing ESC';
  70. } else if (reason === ModalDismissReasons.BACKDROP_CLICK) {
  71. return 'by clicking on a backdrop';
  72. } else {
  73. return `with: ${reason}`;
  74. }
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement