+ Button Toggle inside of a Reactive form
+
+ Bold
+ Italic
+ Underline
+
+ Chosen value is {{fontStyleControl.value}}
+
+
diff --git a/src/components-examples/material/button-toggle/button-toggle-forms/button-toggle-forms-example.ts b/src/components-examples/material/button-toggle/button-toggle-forms/button-toggle-forms-example.ts
new file mode 100644
index 000000000000..fc9dcdfab6fa
--- /dev/null
+++ b/src/components-examples/material/button-toggle/button-toggle-forms/button-toggle-forms-example.ts
@@ -0,0 +1,14 @@
+import {Component} from '@angular/core';
+import {FormControl} from '@angular/forms';
+
+/**
+ * @title Button-toggles with forms
+ */
+@Component({
+ selector: 'button-toggle-forms-example',
+ templateUrl: 'button-toggle-forms-example.html',
+})
+export class ButtonToggleFormsExample {
+ fontStyleControl = new FormControl();
+ fontStyle?: string;
+}
diff --git a/src/components-examples/material/button-toggle/index.ts b/src/components-examples/material/button-toggle/index.ts
index 43bd7663bd94..618e8d05f2cf 100644
--- a/src/components-examples/material/button-toggle/index.ts
+++ b/src/components-examples/material/button-toggle/index.ts
@@ -1,4 +1,5 @@
import {NgModule} from '@angular/core';
+import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {MatButtonToggleModule} from '@angular/material/button-toggle';
import {MatIconModule} from '@angular/material/icon';
import {
@@ -9,12 +10,14 @@ import {
} from './button-toggle-exclusive/button-toggle-exclusive-example';
import {ButtonToggleOverviewExample} from './button-toggle-overview/button-toggle-overview-example';
import {ButtonToggleHarnessExample} from './button-toggle-harness/button-toggle-harness-example';
+import {ButtonToggleFormsExample} from './button-toggle-forms/button-toggle-forms-example';
export {
ButtonToggleAppearanceExample,
ButtonToggleExclusiveExample,
ButtonToggleOverviewExample,
ButtonToggleHarnessExample,
+ ButtonToggleFormsExample,
};
const EXAMPLES = [
@@ -22,12 +25,15 @@ const EXAMPLES = [
ButtonToggleExclusiveExample,
ButtonToggleOverviewExample,
ButtonToggleHarnessExample,
+ ButtonToggleFormsExample,
];
@NgModule({
imports: [
+ FormsModule,
MatButtonToggleModule,
MatIconModule,
+ ReactiveFormsModule,
],
declarations: EXAMPLES,
exports: EXAMPLES,
diff --git a/src/material/button-toggle/button-toggle.md b/src/material/button-toggle/button-toggle.md
index 46564635a037..b4e6b3228b83 100644
--- a/src/material/button-toggle/button-toggle.md
+++ b/src/material/button-toggle/button-toggle.md
@@ -22,6 +22,10 @@ be configured globally using the `MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS` injection t
+### Use with `@angular/forms`
+`