diff --git a/README.md b/README.md
index ca4c8f7..0aa1c40 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,9 @@ The idea here is to provide ready to use Angular templates with typical [Materia
### Option 1: Copy layout code to an existing Angular app
-#### Step 1: Add MDC-Web
+#### Step 1: Add MDC-Web (optional)
+
+This step is optional. You only need to do it if target layout uses any MDC-Web component. See layout description for a list of used components.
1. Run `yarn add material-components-web` or `npm install material-components-web`. The package includes all MDC components/APIs. Don't worry,
only necessary parts will be bundled into your application.
@@ -46,11 +48,12 @@ only necessary parts will be bundled into your application.
1. Clone the repo, or download the latest version from [Releases](https://github.com/kekscs/angular-material-layout-kit/releases).
2. Copy the necessary layout component files to your app. Layouts can be found in [/src/app/layouts](https://github.com/kekscs/angular-material-layout-kit/tree/master/src/app/layouts) folder.
-3. Import layout into your _src/app/app-routing.module.ts_ file:
+3. Add layout component to target module declarations. Usually you need to import layout component into your `app.module.ts` and add it to `declarations` array.
+4. Use layout in you routing. Usually you need to import layout into your `src/app/app-routing.module.ts` file:
```ts
import { Layout101Component } from './layouts/layout101/layout101.component'
```
-4. Configure layout for a route like this:
+5. Set the layout for a route like this:
```ts
{
path: 'home',
@@ -60,6 +63,7 @@ import { Layout101Component } from './layouts/layout101/layout101.component'
]
}
```
+6. Don't forget to import modules of Angular Material components, used in the layout.
### Option 2: Use **angular-material-layout-kit** as a starter template
diff --git a/package.json b/package.json
index 24d622c..278981a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "angular-material-layout-kit",
- "version": "0.1.0-alpha.1",
+ "version": "0.1.0-alpha.2",
"scripts": {
"ng": "ng",
"start": "ng serve",
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 047d6e3..08efd4a 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -4,11 +4,13 @@ import { RouterModule, Routes } from '@angular/router';
// Layouts
import { AppLayoutComponent } from './layouts/app-layout/app-layout.component';
import { Layout101Component } from './layouts/layout101/layout101.component';
+import { Layout202Component } from "./layouts/layout202/layout202.component";
import { Layout203Component } from './layouts/layout203/layout203.component';
// Pages
import { HomePage } from './pages/home/home.page';
import { Layout101Page } from './pages/layout101/layout101.page';
+import { Layout202Page } from "./pages/layout202/layout202.page";
import { Layout203Page } from './pages/layout203/layout203.page';
@@ -28,6 +30,13 @@ const routes: Routes = [
{ path: '', component: Layout101Page }
]
},
+ {
+ path: 'layout202',
+ component: Layout202Component,
+ children: [
+ { path: '', component: Layout202Page }
+ ]
+ },
{
path: 'layout203',
component: Layout203Component,
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 9455643..dd21c8b 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -15,6 +15,7 @@ import { HomePage } from './pages/home/home.page';
import { DummyPageContentComponent } from './components/dummy-page-content/dummy-page-content.component';
import { Layout101Page } from './pages/layout101/layout101.page';
import { Layout203Page } from './pages/layout203/layout203.page';
+import { Layout202Page } from './pages/layout202/layout202.page';
@NgModule({
@@ -24,6 +25,7 @@ import { Layout203Page } from './pages/layout203/layout203.page';
DummyPageContentComponent,
Layout101Page,
Layout203Page,
+ Layout202Page,
],
imports: [
BrowserModule,
diff --git a/src/app/layouts/app-layout/app-layout.component.ts b/src/app/layouts/app-layout/app-layout.component.ts
index 0111797..8766a49 100644
--- a/src/app/layouts/app-layout/app-layout.component.ts
+++ b/src/app/layouts/app-layout/app-layout.component.ts
@@ -12,7 +12,6 @@ const GITHUB_ICON = `
@Component({
- selector: 'app-layout',
templateUrl: './app-layout.component.html',
styleUrls: ['./app-layout.component.scss']
})
diff --git a/src/app/layouts/layout101/layout101.component.ts b/src/app/layouts/layout101/layout101.component.ts
index 082537b..284f362 100644
--- a/src/app/layouts/layout101/layout101.component.ts
+++ b/src/app/layouts/layout101/layout101.component.ts
@@ -3,7 +3,6 @@ import { MDCTopAppBar } from '@material/top-app-bar';
@Component({
- selector: 'app-layout101',
templateUrl: './layout101.component.html',
styleUrls: ['./layout101.component.scss']
})
diff --git a/src/app/layouts/layout202/layout202.component.html b/src/app/layouts/layout202/layout202.component.html
new file mode 100644
index 0000000..d7a3309
--- /dev/null
+++ b/src/app/layouts/layout202/layout202.component.html
@@ -0,0 +1,49 @@
+
+
+
+ Key Components:Toolbar,
+ Sidenav. This version of layout #202 doesn't
+ use MDC Web's @material/top-app-bar.
+ Therefore scrolling downward doesn't reveal the top app bar. I plan to create another version of this layout
+ using @material/top-app-bar.
+
+
+ Behavior: In desktop mode, drawer (or sidenav) is always visible. Top app bar gets scrolled together with content.
+
+ In tablet/phone modes, drawer is hidden to maximize space available for content. It can be revealed by clicking the menu icon in top app bar.
+
+
Properly handled scrolling of main content when modal drawer is opened. In tablet/phone modes, when modal drawer is opened,
+ main content behind doesn't scroll.
Behavior: In desktop mode, top app bar and drawer are always visible. Only content scrolls.
@@ -17,6 +17,7 @@
Layout #203
Also top app bar is not fixed anymore. Scrolling upward hides the top app bar, scrolling downward reveals the top app bar,
thus freeing even more space for content.