Kaynağa Gözat

[fix]

檀家一覧表の初期表示を修正
・ChangeDetectorRefをAngularのngOnInitに追加
poohr 1 hafta önce
ebeveyn
işleme
696b6510c9
1 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 5
    2
      src/app/pages/danka-list/danka-list.ts

+ 5
- 2
src/app/pages/danka-list/danka-list.ts Dosyayı Görüntüle

1
-import { Component, OnInit } from '@angular/core';
1
+import { ChangeDetectorRef, Component, OnInit, computed } from '@angular/core';
2
+import { toSignal } from '@angular/core/rxjs-interop';
2
 import { RouterLink } from '@angular/router';
3
 import { RouterLink } from '@angular/router';
3
 import { DankaService } from '../../services/dankaService';
4
 import { DankaService } from '../../services/dankaService';
4
 import { FamilyService } from '../../services/family-service';
5
 import { FamilyService } from '../../services/family-service';
64
   constructor(
65
   constructor(
65
     private dankaService: DankaService,
66
     private dankaService: DankaService,
66
     private familyService: FamilyService,
67
     private familyService: FamilyService,
68
+    private cdr: ChangeDetectorRef,
67
   ) {}
69
   ) {}
68
 
70
 
69
   // 非同期初期化
71
   // 非同期初期化
74
   async init(): Promise<void> {
76
   async init(): Promise<void> {
75
     this.dankaList = await this.dankaService.getDankaList();
77
     this.dankaList = await this.dankaService.getDankaList();
76
     this.showAllDanka();
78
     this.showAllDanka();
79
+    this.cdr.detectChanges();
77
   }
80
   }
78
 
81
 
79
   showAllDanka() {
82
   showAllDanka() {
158
   private normalizeName(name: string): string {
161
   private normalizeName(name: string): string {
159
     return name.replace(/\s/g, '');
162
     return name.replace(/\s/g, '');
160
   }
163
   }
161
-}
164
+}

Loading…
İptal
Kaydet