Skip to content

Commit 73bf531

Browse files
committed
fix: set the name and value attributes
1 parent 31be6d5 commit 73bf531

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/toggle/toggle.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ export class Toggle extends Checkbox {
102102
*/
103103
static toggleCount = 0;
104104

105+
/**
106+
* Variable set the value to input true/false.
107+
*/
108+
value = false;
109+
110+
/**
111+
* Variable set the name to input same as Id.
112+
*/
113+
name = "toggle-" + Toggle.toggleCount;
114+
105115
/**
106116
* Text that is set on the left side of the toggle.
107117
*/
@@ -193,6 +203,7 @@ export class Toggle extends Checkbox {
193203
this.change.emit(event);
194204
/* end deprecation */
195205

206+
this.value = this.checked;
196207
this.checkedChange.emit(this.checked);
197208
this.propagateChange(this.checked);
198209
}

0 commit comments

Comments
 (0)