Skip to content

docs(material/slide-toggle): add examples with labelPosition="before" #28899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<mat-slide-toggle>Slide me!</mat-slide-toggle>
<p><mat-slide-toggle>Slide me!</mat-slide-toggle></p>
<p><mat-slide-toggle labelPosition="before">...and slide me too!</mat-slide-toggle></p>
7 changes: 7 additions & 0 deletions src/dev-app/slide-toggle/slide-toggle-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<mat-slide-toggle [disabled]="firstToggle">Disable Bound</mat-slide-toggle>
<mat-slide-toggle hideIcon [(ngModel)]="firstToggle">No icon</mat-slide-toggle>

<p>With label before the slide toggle.</p>

<mat-slide-toggle labelPosition="before" color="primary" [(ngModel)]="firstToggle">Default Slide Toggle</mat-slide-toggle>
<mat-slide-toggle labelPosition="before" [(ngModel)]="firstToggle" disabled>Disabled Slide Toggle</mat-slide-toggle>
<mat-slide-toggle labelPosition="before" [disabled]="firstToggle">Disable Bound</mat-slide-toggle>
<mat-slide-toggle labelPosition="before" hideIcon [(ngModel)]="firstToggle">No icon</mat-slide-toggle>

<p>Example where the slide toggle is required inside of a form.</p>

<form #form="ngForm" (ngSubmit)="onFormSubmit()">
Expand Down