mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs(getting-started): include yarn snippets (#9137)
This commit is contained in:
@@ -5,29 +5,49 @@ For existing apps, follow these steps to begin using Angular Material.
|
||||
|
||||
### Step 1: Install Angular Material and Angular CDK
|
||||
|
||||
You can use either the npm or yarn command-line tool to install packages. Use whichever is appropriate for your project in the examples below.
|
||||
|
||||
#### NPM
|
||||
```bash
|
||||
npm install --save @angular/material @angular/cdk
|
||||
```
|
||||
#### Yarn
|
||||
```bash
|
||||
yarn add @angular/material @angular/cdk
|
||||
```
|
||||
|
||||
|
||||
#### Alternative: Snapshot Build
|
||||
|
||||
A snapshot build with the latest changes from master is also available. Note that this snapshot
|
||||
build should not be considered stable and may break between releases.
|
||||
|
||||
#### NPM
|
||||
```bash
|
||||
npm install --save angular/material2-builds angular/cdk-builds
|
||||
```
|
||||
|
||||
#### Yarn
|
||||
```bash
|
||||
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.
|
||||
|
||||
#### NPM
|
||||
```bash
|
||||
npm install --save @angular/animations
|
||||
```
|
||||
|
||||
#### Yarn
|
||||
```bash
|
||||
yarn install @angular/animations
|
||||
```
|
||||
|
||||
**Note:** `@angular/animations` uses the WebAnimation API that isn't supported by all browsers yet.
|
||||
If you want to support Material component animations in these browsers, you'll have to
|
||||
[include a polyfill](https://github.com/web-animations/web-animations-js).
|
||||
|
||||
Reference in New Issue
Block a user