Skip to content

Commit 4421117

Browse files
author
Danil Khaliulin
committed
dialog сторис: убираем @ViewChild('footer'), переменная #footer доступна из ng-template
1 parent b729d9e commit 4421117

7 files changed

Lines changed: 12 additions & 24 deletions

src/stories/components/dialog/dialog.stories.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const Basic: Story = {
135135
source: {
136136
language: 'ts',
137137
code: `
138-
import { Component, TemplateRef, ViewChild } from '@angular/core';
138+
import { Component } from '@angular/core';
139139
import { Button } from 'primeng/button';
140140
import { DialogComponent } from '@cdek-it/angular-ui-kit';
141141
@@ -146,7 +146,6 @@ import { DialogComponent } from '@cdek-it/angular-ui-kit';
146146
template: \`${dialogDefaultTemplate}\`,
147147
})
148148
export class DialogBasicComponent {
149-
@ViewChild('footer') footer!: TemplateRef<any>;
150149
visible = false;
151150
}
152151
`,
@@ -167,7 +166,7 @@ export const Small: Story = {
167166
source: {
168167
language: 'ts',
169168
code: `
170-
import { Component, TemplateRef, ViewChild } from '@angular/core';
169+
import { Component } from '@angular/core';
171170
import { Button } from 'primeng/button';
172171
import { DialogComponent } from '@cdek-it/angular-ui-kit';
173172
@@ -178,7 +177,6 @@ import { DialogComponent } from '@cdek-it/angular-ui-kit';
178177
template: \`${dialogSmallTemplate}\`,
179178
})
180179
export class DialogSmallComponent {
181-
@ViewChild('footer') footer!: TemplateRef<any>;
182180
visible = false;
183181
}
184182
`,
@@ -199,7 +197,7 @@ export const Large: Story = {
199197
source: {
200198
language: 'ts',
201199
code: `
202-
import { Component, TemplateRef, ViewChild } from '@angular/core';
200+
import { Component } from '@angular/core';
203201
import { Button } from 'primeng/button';
204202
import { DialogComponent } from '@cdek-it/angular-ui-kit';
205203
@@ -210,7 +208,6 @@ import { DialogComponent } from '@cdek-it/angular-ui-kit';
210208
template: \`${dialogLargeTemplate}\`,
211209
})
212210
export class DialogLargeComponent {
213-
@ViewChild('footer') footer!: TemplateRef<any>;
214211
visible = false;
215212
}
216213
`,
@@ -231,7 +228,7 @@ export const ExtraLarge: Story = {
231228
source: {
232229
language: 'ts',
233230
code: `
234-
import { Component, TemplateRef, ViewChild } from '@angular/core';
231+
import { Component } from '@angular/core';
235232
import { Button } from 'primeng/button';
236233
import { DialogComponent } from '@cdek-it/angular-ui-kit';
237234
@@ -242,7 +239,6 @@ import { DialogComponent } from '@cdek-it/angular-ui-kit';
242239
template: \`${dialogExtraLargeTemplate}\`,
243240
})
244241
export class DialogExtraLargeComponent {
245-
@ViewChild('footer') footer!: TemplateRef<any>;
246242
visible = false;
247243
}
248244
`,
@@ -263,7 +259,7 @@ export const NoModal: Story = {
263259
source: {
264260
language: 'ts',
265261
code: `
266-
import { Component, TemplateRef, ViewChild } from '@angular/core';
262+
import { Component } from '@angular/core';
267263
import { Button } from 'primeng/button';
268264
import { DialogComponent } from '@cdek-it/angular-ui-kit';
269265
@@ -274,7 +270,6 @@ import { DialogComponent } from '@cdek-it/angular-ui-kit';
274270
template: \`${dialogNoModalTemplate}\`,
275271
})
276272
export class DialogNoModalComponent {
277-
@ViewChild('footer') footer!: TemplateRef<any>;
278273
visible = false;
279274
}
280275
`,
@@ -295,7 +290,7 @@ export const NoHeader: Story = {
295290
source: {
296291
language: 'ts',
297292
code: `
298-
import { Component, TemplateRef, ViewChild } from '@angular/core';
293+
import { Component } from '@angular/core';
299294
import { Button } from 'primeng/button';
300295
import { DialogComponent } from '@cdek-it/angular-ui-kit';
301296
@@ -306,7 +301,6 @@ import { DialogComponent } from '@cdek-it/angular-ui-kit';
306301
template: \`${dialogNoHeaderTemplate}\`,
307302
})
308303
export class DialogNoHeaderComponent {
309-
@ViewChild('footer') footer!: TemplateRef<any>;
310304
visible = false;
311305
}
312306
`,

src/stories/components/dialog/examples/dialog-default.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, TemplateRef, ViewChild } from '@angular/core';
1+
import { Component } from '@angular/core';
22
import { Button } from 'primeng/button';
33
import { DialogComponent } from '../../../../lib/components/dialog/dialog.component';
44

@@ -29,6 +29,5 @@ export const template = `
2929
template,
3030
})
3131
export class DialogDefaultComponent {
32-
@ViewChild('footer') footer!: TemplateRef<any>;
3332
visible = false;
3433
}

src/stories/components/dialog/examples/dialog-extra-large.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, TemplateRef, ViewChild } from '@angular/core';
1+
import { Component } from '@angular/core';
22
import { Button } from 'primeng/button';
33
import { DialogComponent } from '../../../../lib/components/dialog/dialog.component';
44

@@ -30,6 +30,5 @@ export const template = `
3030
template,
3131
})
3232
export class DialogExtraLargeComponent {
33-
@ViewChild('footer') footer!: TemplateRef<any>;
3433
visible = false;
3534
}

src/stories/components/dialog/examples/dialog-large.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, TemplateRef, ViewChild } from '@angular/core';
1+
import { Component } from '@angular/core';
22
import { Button } from 'primeng/button';
33
import { DialogComponent } from '../../../../lib/components/dialog/dialog.component';
44

@@ -30,6 +30,5 @@ export const template = `
3030
template,
3131
})
3232
export class DialogLargeComponent {
33-
@ViewChild('footer') footer!: TemplateRef<any>;
3433
visible = false;
3534
}

src/stories/components/dialog/examples/dialog-no-header.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, TemplateRef, ViewChild } from '@angular/core';
1+
import { Component } from '@angular/core';
22
import { Button } from 'primeng/button';
33
import { DialogComponent } from '../../../../lib/components/dialog/dialog.component';
44

@@ -31,6 +31,5 @@ export const template = `
3131
template,
3232
})
3333
export class DialogNoHeaderComponent {
34-
@ViewChild('footer') footer!: TemplateRef<any>;
3534
visible = false;
3635
}

src/stories/components/dialog/examples/dialog-no-modal.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, TemplateRef, ViewChild } from '@angular/core';
1+
import { Component } from '@angular/core';
22
import { Button } from 'primeng/button';
33
import { DialogComponent } from '../../../../lib/components/dialog/dialog.component';
44

@@ -30,6 +30,5 @@ export const template = `
3030
template,
3131
})
3232
export class DialogNoModalComponent {
33-
@ViewChild('footer') footer!: TemplateRef<any>;
3433
visible = false;
3534
}

src/stories/components/dialog/examples/dialog-small.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, TemplateRef, ViewChild } from '@angular/core';
1+
import { Component } from '@angular/core';
22
import { Button } from 'primeng/button';
33
import { DialogComponent } from '../../../../lib/components/dialog/dialog.component';
44

@@ -30,6 +30,5 @@ export const template = `
3030
template,
3131
})
3232
export class DialogSmallComponent {
33-
@ViewChild('footer') footer!: TemplateRef<any>;
3433
visible = false;
3534
}

0 commit comments

Comments
 (0)