tab2.page.ts 690 B

1234567891011121314151617181920212223242526272829303132
  1. import { Component } from '@angular/core';
  2. import { CalendarEvent } from 'angular-calendar';
  3. @Component({
  4. selector: 'app-tab2',
  5. templateUrl: 'tab2.page.html',
  6. styleUrls: ['tab2.page.scss']
  7. })
  8. export class Tab2Page {
  9. memoContent: string = '';
  10. searchQuery: string = '';
  11. memos: string[] = [];
  12. viewDate: Date = new Date();
  13. events: CalendarEvent[] = [];
  14. constructor() {}
  15. addMemo() {
  16. if (this.memoContent.trim() !== '') {
  17. this.memos.push(this.memoContent);
  18. this.memoContent = '';
  19. }
  20. }
  21. filteredMemos() {
  22. return this.memos.filter((memo) => memo.includes(this.searchQuery));
  23. }
  24. dayClicked(day: any) {
  25. console.log('Day clicked:', day);
  26. }
  27. }