Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 034a1f1

Browse files
authored
docs(demo): New snackbar documentation and api (#229)
1 parent 4f68194 commit 034a1f1

File tree

13 files changed

+95
-69
lines changed

13 files changed

+95
-69
lines changed

config/rollup-demo.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import nodeResolve from 'rollup-plugin-node-resolve';
22
import commonjs from 'rollup-plugin-commonjs';
33

44
export default {
5-
input: 'publish-demo/demo-app/main-aot.js',
5+
input: 'publish-demo/main-aot.js',
66
plugins: [
77
nodeResolve(),
88
commonjs({

src/demo-app/app.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
66

77
import { FlexLayoutModule } from '@angular/flex-layout';
88

9+
import { DemoMaterialModule } from './demo-material.module';
10+
911
import { AppComponent } from './app.component';
1012
import { ButtonDemoComponent } from './components/button-demo/button-demo.component';
1113
import { CardDemoComponent } from './components/card-demo/card-demo.component';
@@ -28,8 +30,6 @@ import { TypographyDemoComponent } from './components/typography-demo/typography
2830
import { TabDemoComponent, ItemOneContent, ItemTwoContent, ItemThreeContent } from './components/tab-demo/tab-demo.component';
2931
import { NavbarComponent } from './components/navigation/navbar.component';
3032

31-
import { MaterialModule } from '../lib/public_api';
32-
3333
import { HomeComponent } from './components/home/home.component';
3434

3535
import { demoAppRoutes } from './routes';
@@ -41,7 +41,7 @@ import { demoAppRoutes } from './routes';
4141
HttpModule,
4242
ReactiveFormsModule,
4343
FlexLayoutModule,
44-
MaterialModule,
44+
DemoMaterialModule,
4545
RouterModule.forRoot(demoAppRoutes, { useHash: true })
4646
],
4747
declarations: [

src/demo-app/components/button-demo/button-demo.component.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,6 @@ <h1 mdc-typography-display1>Buttons</h1>
102102
<span style="color:#89bdff">&lt;<span style="color:#89bdff">mdc</span><span style="color:#89bdff">-icon-button</span> <span style="color:#89bdff">material-icon</span>></span>favorite<span style="color:#89bdff">&lt;/<span style="color:#89bdff">mdc</span><span style="color:#89bdff">-icon-button</span>></span>
103103
Icon
104104
<span style="color:#e0c589">&lt;/<span style="color:#e0c589">button</span>></span>
105-
</pre>
106-
<button mdc-button [primary]="true" [raised]="true" (click)="handleClick();">Click event</button>
107-
<pre style="background:#000;color:#f8f8f8"><span style="color:#e0c589">&lt;<span style="color:#e0c589">button</span> <span style="color:#e0c589">mdc-button</span>
108-
[<span style="color:#e0c589">primary</span>]=<span style="color:#65b042">"true"</span>
109-
[<span style="color:#e0c589">raised</span>]=<span style="color:#65b042">"true"</span>
110-
(<span style="color:#e0c589">click</span>)=<span style="color:#65b042">"handleClick();"</span>></span>Click event<span style="color:#e0c589">&lt;/<span style="color:#e0c589">button</span>></span>
111105
</pre>
112106
<button mdc-button [raised]="true" [mdc-theme-dark]="true">Dark theme</button>
113107
<pre style="background:#000;color:#f8f8f8"><span style="color:#e0c589">&lt;<span style="color:#e0c589">button</span> <span style="color:#e0c589">mdc-button</span>
@@ -149,5 +143,5 @@ <h1 mdc-typography-display1>Buttons</h1>
149143
[<span style="color:#e0c589">primary</span>]=<span style="color:#65b042">"true"</span>
150144
[<span style="color:#e0c589">disabled</span>]=<span style="color:#65b042">"true"</span>></span>Disabled<span style="color:#e0c589">&lt;/<span style="color:#e0c589">button</span>></span>
151145
</pre>
152-
<mdc-snackbar #snack></mdc-snackbar></div>
146+
</div>
153147

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
1-
import {
2-
Component,
3-
ViewChild
4-
} from '@angular/core';
5-
6-
import { SnackbarMessage, MdcSnackbarComponent } from '../../../lib/public_api';
1+
import { Component } from '@angular/core';
72

83
@Component({
9-
selector: 'button-demo',
10-
templateUrl: './button-demo.component.html'
4+
selector: 'button-demo',
5+
templateUrl: './button-demo.component.html'
116
})
12-
export class ButtonDemoComponent {
13-
message: SnackbarMessage;
14-
@ViewChild('snack') snack: MdcSnackbarComponent;
15-
16-
handleClick() {
17-
this.message = {
18-
message: 'Sample text',
19-
actionText: 'Ok',
20-
};
21-
this.snack.show(this.message);
22-
}
23-
}
7+
export class ButtonDemoComponent { }

src/demo-app/components/dialog-demo/dialog-demo.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, ViewChild } from '@angular/core';
22
import { FormControl, FormGroup, Validators } from '@angular/forms';
33

4-
import { MdcDialogComponent, MdcTextfieldComponent } from '../../../lib/public_api';
4+
import { MdcDialogComponent, MdcTextfieldComponent } from '@angular-mdc/web';
55

66
@Component({
77
selector: 'dialog-demo',

src/demo-app/components/drawer-demo/drawer-demo.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
import {
77
MdcTemporaryDrawerComponent,
88
MdcPersistentDrawerComponent
9-
} from '../../../lib/public_api';
9+
} from '@angular-mdc/web';
1010

1111
@Component({
1212
selector: 'drawer-demo',

src/demo-app/components/elevation-demo/elevation-demo.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ <h1 mdc-typography-display1>Elevation</h1>
1414
</thead>
1515
<tbody>
1616
<tr>
17-
<td>mdc-elevation="#"</td>
17+
<td>[mdc-elevation]="#"</td>
1818
<td>Elevation values are mapped out in a "z-space" and range from 0 to 24.</td>
1919
</tr>
2020
</tbody>
2121
</table>
2222
<div fxLayout="row" fxLayoutWrap>
2323
<figure [mdc-elevation]="i" class="demo-surface" *ngFor="let i of items">
24-
<figcaption>mdc-elevation="{{i}}"</figcaption>
24+
<figcaption>[mdc-elevation]="{{i}}"</figcaption>
2525
</figure>
2626
</div>
2727
</div>

src/demo-app/components/fab-demo/fab-demo.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, ViewChild } from '@angular/core';
22

3-
import { MdcFabComponent } from '../../../lib/public_api';
3+
import { MdcFabComponent } from '@angular-mdc/web';
44

55
@Component({
66
selector: 'fab-demo',

src/demo-app/components/menu-demo/menu-demo.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
ViewChild
44
} from '@angular/core';
55

6-
import { MdcMenuComponent } from '../../../lib/public_api';
6+
import { MdcMenuComponent } from '@angular-mdc/web';
77

88
@Component({
99
selector: 'menu-demo',

src/demo-app/components/navigation/navbar.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component, ViewChild } from '@angular/core';
22
import { Router } from '@angular/router';
33

44
import { navigationLinks } from '../../common/navigation-links';
5-
import { MdcTemporaryDrawerComponent } from '../../../lib/public_api';
5+
import { MdcTemporaryDrawerComponent } from '@angular-mdc/web';
66

77
@Component({
88
selector: 'navbar',

0 commit comments

Comments
 (0)