Skip to content
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

chore(docs): add how-to's for angular material inclusion #3897

Closed

Conversation

jeremymwells
Copy link
Contributor

applies to #2711

Install the `@angular/material` library and add the dependency to package.json...
```bash
npm install --save @angular/material

Copy link
Contributor

@hansl hansl Jan 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty line

Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good first start. cheers!


Create a new project and navigate into the project...
```
ng new my-app && cd my-app
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split into two lines.

Now that the project is set up, it must be configured to include the CSS for a theme. Angular Material ships with some prebuilt theming, which is located in `node_modules/@angular/material/core/theming/prebuilt`.

To add an angular CSS theme and material icons to your app...
```css
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sass typing, not css.

- [Theming Angular Material](https://material.angular.io/guide/theming)
- [Theming your own components](https://material.angular.io/guide/theming-your-components)

# Include [Flex Layout](https://github.com/angular/flex-layout) for [Angular Material](https://material.angular.io)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Flex Layout is a separate library and should have its own guide, since you can use it without Material. I'm asking around.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. I considered a separate guide for it, but stitching them together made sense when I considered that they currently ship together for v1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hansl - am I to do a separate PR for the flex stuff?

ng new my-app && cd my-app
```

With the new project created and ready, you will next need to install Angular Material.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line, it's just repeating the lines above and below it.


Import the Angular Material NgModule into your app module...
```javascript
//in src/app/app.module.ts -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove -->?

],
...
})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra empty line.


```

Now that the project is set up, it must be configured to include the CSS for a theme. Angular Material ships with some prebuilt theming, which is located in `node_modules/@angular/material/core/theming/prebuilt`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prebuilt/ is a directory, you should end that path with an extra / to indicate so.

@import '~https://fonts.googleapis.com/icon?family=Material+Icons';
```

Run `ng serve` to run your application in develop mode, and navigate to `http://localhost:4200`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"in development mode".


Run `ng serve` to run your application in develop mode, and navigate to `http://localhost:4200`.

To verify angular material has been set up correctly, change `src/app/app.component.html` to the following...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capital A and capital M to Angular Material, here and everywhere else.

@jeremymwells jeremymwells force-pushed the docs-angular-material branch 2 times, most recently from 22ab909 to bed3566 Compare January 8, 2017 03:11
Copy link
Contributor Author

@jeremymwells jeremymwells left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hansl - all changes made (minus undecided Flex-Layout scenario). Lmk.

- [Theming Angular Material](https://material.angular.io/guide/theming)
- [Theming your own components](https://material.angular.io/guide/theming-your-components)

# Include [Flex Layout](https://github.com/angular/flex-layout) for [Angular Material](https://material.angular.io)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. I considered a separate guide for it, but stitching them together made sense when I considered that they currently ship together for v1.

@jeremymwells jeremymwells force-pushed the docs-angular-material branch 2 times, most recently from 981efdc to 6123429 Compare January 13, 2017 18:06
@Brocco Brocco mentioned this pull request Jan 17, 2017
38 tasks
@jeremymwells jeremymwells force-pushed the docs-angular-material branch 2 times, most recently from 3a0cc02 to 6dd682d Compare January 18, 2017 16:23
@jeremymwells jeremymwells changed the title chore(docs): add how-to's for angular material & flex-layout inclusion chore(docs): add how-to's for angular material inclusion Jan 20, 2017
@Brocco
Copy link
Contributor

Brocco commented Jan 20, 2017

Can you please rebase

@jeremymwells jeremymwells force-pushed the docs-angular-material branch from 6dd682d to feefa35 Compare January 20, 2017 01:28
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this pull request Feb 9, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants