-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs: Getting started guide update about animations #12377
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,7 @@ yarn add angular/material2-builds angular/cdk-builds | |
|
||
### Step 2: Animations | ||
|
||
Some Material components depend on the Angular animations module in order to be able to do | ||
more advanced transitions. If you want these animations to work in your app, you have to | ||
install the `@angular/animations` module and include the `BrowserAnimationsModule` in your app. | ||
Animations package is required to build application with Material components, but you don't have to configure it unless you use animated components like Drawer, Bottom Sheet etc. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would omit the part "but you don't have to configure it unless you use animated components like Drawer, Bottom Sheet etc." since we might end up adding animations to other components in the future. For the getting started guide, it's simpler to always tell people to add an animations module. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jelbourn what do you think about to move the installation part to the Step 1 and here to leave only configuration of Browser/Noop animation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense to me. |
||
|
||
#### NPM | ||
```bash | ||
|
@@ -48,6 +46,8 @@ npm install --save @angular/animations | |
yarn add @angular/animations | ||
``` | ||
|
||
If you want to provide animations for these components include the `BrowserAnimationsModule` in your app. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would phrase this as Once the animations package is installed, import `BrowserAnimationsModule` into your application. |
||
|
||
```ts | ||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; | ||
|
||
|
@@ -59,7 +59,7 @@ import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; | |
export class PizzaPartyAppModule { } | ||
``` | ||
|
||
If you don't want to add another dependency to your project, you can use the `NoopAnimationsModule`. | ||
If you want to disable animation for these components you can use the `NoopAnimationsModule`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would phrase this as Alternatively, you can disable animations by importing `NoopAnimationsModule`. |
||
|
||
```ts | ||
import {NoopAnimationsModule} from '@angular/platform-browser/animations'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "Material components" -> "Angular Material"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another nit: "Animations package" -> "The
@angular/animations
package"