This project was generated with Angular CLI version 6.0.8.
Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically
reload if you change any of the source files.
Run ng generate component <component-name> to generate a new component. You can also use
ng generate directive|pipe|service|class|guard|interface|enum|module.
- Run
npm install @angular/material @angular/cdk @angular/animationsto install the Angular Material UI library and its associated Content Development Kit - Add a
material.module.tsmodule to thesrcdirectory for all Material module imports. Seematerial.module.tsin this project for an example. - Export the NgModule defined in
material.module.tsand import it inapp.module.ts - Add the BrowserAnimationsModel to
app.module.ts - In the
index.htmlfile add links to the Roboto font and the Material Icons libraries. See theindex.htmlfile in this project for an example. - A theme is required to use the Material UI library. There are several pre-built themes.
An example of how to include one of these in an application can be found in
style.scssfile in this project.
SCSS provides the ability to declare variables that can be imported into other stylesheets.
This concept can be used to define styles that are used throughout the application, keeping things DRY.
A variation of the 7-1 (seven folders, one file) pattern is used in this project to organize reusable styles.
The 7-1 pattern is defined in the style guide located here: https://sass-guidelin.es/#architecture. It is
implemented within this project in the src/stylesheets directory. The variations are:
- The 7-1 pattern uses a directory named
sassto house all the stylesheets. I am opposed to naming directories after a technology as the underlying technology can change. Thus, the directory is namedstylesheetswithin this project. - One of the seven folders in the pattern is
pages. This folder is omitted from this project because it is a single-page application that uses components. Apagesdirectory clashes with that paradigm, IMO. - The
componentsdirectory in the 7-1 pattern is renamed tocontrolsin this project to eliminate confusion between an UI component and an Angular components.
Run ng build to build the project. The build artifacts will be stored in the dist/ directory.
Use the --prod flag for a production build.
Run ng test to execute the unit tests via Karma.
Run ng e2e to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help or go check out the
Angular CLI README.