Skip to content

Commit e5d8ca0

Browse files
committed
Merge branch 'material2' of https://github.com/Angular-RU/angular-universal-starter into material2
2 parents ad919e9 + b848c41 commit e5d8ca0

File tree

7 files changed

+70
-5
lines changed

7 files changed

+70
-5
lines changed

src/app/materialPage/materialPage.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ <h2>Autocomplete</h2>
1313
</mat-option>
1414
</mat-autocomplete>
1515

16+
<button mat-button (click)="openSnackBar()" aria-label="Show an example snack-bar">
17+
Pizza party
18+
</button>
19+
1620
<h2>Button</h2>
1721

1822
<button mat-button>go</button>

src/app/materialPage/materialPage.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import { PizzaComponent } from './pizza/pizza.component';
12
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
3+
import { MatSnackBar } from '@angular/material';
4+
25
import {
36
CdkTableModule,
47
DataSource
@@ -31,4 +34,12 @@ export class MaterialPageComponent {
3134
'test2'
3235
];
3336

37+
constructor(public snackBar: MatSnackBar) {
38+
}
39+
40+
openSnackBar() {
41+
this.snackBar.openFromComponent(PizzaComponent, {
42+
duration: 500,
43+
});
44+
}
3445
}

src/app/materialPage/materialPage.module.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { CommonModule } from '@angular/common';
22
import { MaterialPageComponent } from './materialPage.component';
33
import { MaterialPageRoutes } from './materialPage.routing';
4-
import {Component, NgModule} from '@angular/core';
5-
import {ServerModule} from '@angular/platform-server';
6-
import {BrowserModule} from '@angular/platform-browser';
7-
import {Observable} from 'rxjs/Observable';
4+
import { Component, NgModule } from '@angular/core';
5+
import { ServerModule } from '@angular/platform-server';
6+
import { BrowserModule } from '@angular/platform-browser';
7+
import { Observable } from 'rxjs/Observable';
88
import {
99
MatAutocompleteModule,
1010
MatButtonModule,
@@ -43,6 +43,7 @@ import {
4343
DataSource
4444
} from '@angular/cdk/table';
4545
import 'rxjs/add/observable/of';
46+
import { PizzaComponent } from './pizza/pizza.component';
4647

4748
@NgModule({
4849
imports: [
@@ -84,6 +85,9 @@ import 'rxjs/add/observable/of';
8485
// CDK Modules
8586
CdkTableModule
8687
],
87-
declarations: [MaterialPageComponent]
88+
declarations: [MaterialPageComponent,
89+
PizzaComponent
90+
],
91+
entryComponents: [PizzaComponent]
8892
})
8993
export class MaterialPageModule { }
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>
2+
pizza works!
3+
</p>

src/app/materialPage/pizza/pizza.component.scss

Whitespace-only changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* tslint:disable:no-unused-variable */
2+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3+
import { By } from '@angular/platform-browser';
4+
import { DebugElement } from '@angular/core';
5+
6+
import { PizzaComponent } from './pizza.component';
7+
8+
describe('PizzaComponent', () => {
9+
let component: PizzaComponent;
10+
let fixture: ComponentFixture<PizzaComponent>;
11+
12+
beforeEach(async(() => {
13+
TestBed.configureTestingModule({
14+
declarations: [ PizzaComponent ]
15+
})
16+
.compileComponents();
17+
}));
18+
19+
beforeEach(() => {
20+
fixture = TestBed.createComponent(PizzaComponent);
21+
component = fixture.componentInstance;
22+
fixture.detectChanges();
23+
});
24+
25+
it('should create', () => {
26+
expect(component).toBeTruthy();
27+
});
28+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-pizza',
5+
templateUrl: './pizza.component.html',
6+
styleUrls: ['./pizza.component.scss']
7+
})
8+
export class PizzaComponent implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit() {
13+
}
14+
15+
}

0 commit comments

Comments
 (0)