質問編集履歴

3

文字修正

2022/10/18 02:54

投稿

aaaaab
aaaaab

スコア1

test CHANGED
File without changes
test CHANGED
@@ -35,7 +35,7 @@
35
35
  })
36
36
  export class aaaComponent extends BaaaComponent {
37
37
  constructor(
38
- aaaService: AAAService,
38
+ aaaService: AaaService,
39
39
  ) {
40
40
  super(aaaService);
41
41
  }

2

軽微な修正

2022/10/18 02:53

投稿

aaaaab
aaaaab

スコア1

test CHANGED
File without changes
test CHANGED
@@ -30,7 +30,7 @@
30
30
  selector: 'app-aaa',
31
31
  templateUrl: './aaa.component.html',
32
32
  styleUrls: ['./aaa.component.css'],
33
- providers: [AAAService],
33
+ providers: [AaaService],
34
34
  changeDetection: ChangeDetectionStrategy.OnPush,
35
35
  })
36
36
  export class aaaComponent extends BaaaComponent {

1

情報の追記

2022/10/18 02:48

投稿

aaaaab
aaaaab

スコア1

test CHANGED
File without changes
test CHANGED
@@ -15,3 +15,84 @@
15
15
 
16
16
  をご存知であれば教えて頂けると幸いです。
17
17
  よろしくお願いたします。
18
+
19
+ ### 追加情報
20
+ Angular CLI: 11.2.4
21
+ Node: 14.15.4
22
+
23
+ Angular: 11.2.5
24
+
25
+ またそれぞれのファイルには以下のような内容の記述です。(import部分は省略し多少簡略化しています。)
26
+
27
+ #### aaa.component.ts
28
+ ```ts
29
+ @Component({
30
+ selector: 'app-aaa',
31
+ templateUrl: './aaa.component.html',
32
+ styleUrls: ['./aaa.component.css'],
33
+ providers: [AAAService],
34
+ changeDetection: ChangeDetectionStrategy.OnPush,
35
+ })
36
+ export class aaaComponent extends BaaaComponent {
37
+ constructor(
38
+ aaaService: AAAService,
39
+ ) {
40
+ super(aaaService);
41
+ }
42
+ }
43
+ ```
44
+
45
+ #### aaa.service.ts
46
+ ```ts
47
+ @Injectable()
48
+ export class aaaService extends BaaaService {
49
+ constructor(
50
+ datePipe: DatePipe,
51
+ ) {
52
+ super(datePipe);
53
+ }
54
+ }
55
+ ```
56
+
57
+ #### b-aaa.component.ts
58
+ ```ts
59
+ @Component({
60
+ template: '',
61
+ changeDetection: ChangeDetectionStrategy.OnPush,
62
+ })
63
+ export abstract class BaaaComponent implements OnInit, AfterViewInit, OnDestroy, DoCheck {
64
+
65
+ ngOnInit(): void {
66
+ this.aaaService.initAaa():
67
+ ...(省略)
68
+ }
69
+
70
+ ngDoCheck() {
71
+ ...(省略)
72
+ }
73
+
74
+ ngAfterViewInit(): void {
75
+ ...(省略)
76
+ }
77
+
78
+ ngOnDestroy() {
79
+ ...(省略)
80
+ }
81
+ }
82
+ ```
83
+
84
+ #### b-aaa.service.ts
85
+ ```ts
86
+ @Injectable()
87
+ export class foo {
88
+
89
+ async initAaa() (
90
+ ...(省略)
91
+ }
92
+
93
+ addData() {
94
+ ...(省略)
95
+ }
96
+
97
+ }
98
+ ```