-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoggleswitch-checked.component.ts
More file actions
47 lines (44 loc) · 1.35 KB
/
toggleswitch-checked.component.ts
File metadata and controls
47 lines (44 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { Component } from '@angular/core';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { StoryObj } from '@storybook/angular';
import { ToggleSwitchComponent } from '../../../../lib/components/toggleswitch/toggleswitch.component';
@Component({
selector: 'app-toggleswitch-checked',
standalone: true,
imports: [ToggleSwitchComponent, ReactiveFormsModule],
template: `
<toggleswitch [formControl]="control"></toggleswitch>
`,
})
export class ToggleSwitchCheckedComponent {
control = new FormControl(true);
}
export const Checked: StoryObj = {
render: () => ({
template: `<app-toggleswitch-checked></app-toggleswitch-checked>`,
}),
parameters: {
docs: {
description: { story: 'Переключатель во включённом состоянии.' },
source: {
language: 'ts',
code: `
import { Component } from '@angular/core';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { ToggleSwitchComponent } from '@cdek-it/angular-ui-kit';
@Component({
selector: 'app-toggleswitch-checked',
standalone: true,
imports: [ToggleSwitchComponent, ReactiveFormsModule],
template: \`
<toggleswitch [formControl]="control"></toggleswitch>
\`,
})
export class ToggleSwitchCheckedComponent {
control = new FormControl(true);
}
`,
},
},
},
};