Skip to content

Commit 571a872

Browse files
docs: use standalone import in getting-started guide (#32826)
The getting-started guide imported MatSlideToggleModule and mentioned NgModule as an alternative. Update to import the standalone MatSlideToggle component directly, which is the recommended pattern for new Angular applications. Partially addresses #32709
1 parent e8d54c3 commit 571a872

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

guides/getting-started.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,13 @@ You're done! Angular Material is now configured to be used in your application.
4040

4141
Let's display a slide toggle component in your app and verify that everything works.
4242

43-
You need to import the `MatSlideToggleModule` that you want to display by adding the following lines to
44-
your standalone component's imports, or otherwise your component's `NgModule`.
43+
You need to import the `MatSlideToggle` component by adding it to your component's `imports`:
4544

4645
```ts
47-
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
46+
import {MatSlideToggle} from '@angular/material/slide-toggle';
4847

49-
@Component ({
50-
imports: [
51-
MatSlideToggleModule,
52-
]
48+
@Component({
49+
imports: [MatSlideToggle],
5350
})
5451
class AppComponent {}
5552
```

0 commit comments

Comments
 (0)