Skip to content

Commit 0e07eaa

Browse files
committed
add angular/cdk/layout ( error)
1 parent e5d8ca0 commit 0e07eaa

File tree

4 files changed

+36
-19
lines changed

4 files changed

+36
-19
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ yarn.lock
77
prerender.js
88
prerender.js
99
.DS_Store
10+
static/

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,36 @@
1818
},
1919
"private": true,
2020
"dependencies": {
21-
"@angular/animations": "5.0.1",
22-
"@angular/cdk": "5.0.0-rc0",
23-
"@angular/common": "5.0.1",
24-
"@angular/compiler": "5.0.1",
25-
"@angular/core": "5.0.1",
26-
"@angular/forms": "5.0.1",
27-
"@angular/http": "5.0.1",
28-
"@angular/platform-browser": "5.0.1",
29-
"@angular/platform-browser-dynamic": "5.0.1",
30-
"@angular/router": "5.0.1",
31-
"@ngtools/webpack": "1.9.0-beta.0",
21+
"@angular/animations": "5.0.3",
22+
"@angular/cdk": "5.0.0-rc.2",
23+
"@angular/material": "5.0.0-rc.2",
24+
"@angular/common": "5.0.3",
25+
"@angular/compiler": "5.0.3",
26+
"@angular/core": "5.0.3",
27+
"@angular/forms": "5.0.3",
28+
"@angular/http": "5.0.3",
29+
"@angular/platform-browser": "5.0.3",
30+
"@angular/platform-browser-dynamic": "5.0.3",
31+
"@angular/router": "5.0.3",
32+
"@ngtools/webpack": "1.9.0-rc.0",
3233
"@nguniversal/common": "5.0.0-beta.5",
3334
"@nguniversal/express-engine": "5.0.0-beta.5",
3435
"@nguniversal/module-map-ngfactory-loader": "5.0.0-beta.5",
35-
"@types/node": "8.0.51",
36+
"@types/node": "8.0.53",
3637
"cookie-parser": "1.4.3",
3738
"core-js": "2.5.1",
3839
"hammerjs": "2.0.8",
3940
"ngx-cookie-service": "1.0.9",
4041
"preboot": "5.1.7",
4142
"rxjs": "5.5.2",
42-
"uglify-es": "3.1.9",
43+
"uglify-es": "3.2.0",
4344
"zone.js": "0.8.18"
4445
},
4546
"devDependencies": {
46-
"@angular/cli": "1.6.0-beta.0",
47-
"@angular/compiler-cli": "5.0.1",
48-
"@angular/language-service": "5.0.1",
49-
"@angular/material": "5.0.0-rc0",
50-
"@angular/platform-server": "5.0.1",
47+
"@angular/cli": "1.6.0-rc.0",
48+
"@angular/compiler-cli": "5.0.3",
49+
"@angular/language-service": "5.0.3",
50+
"@angular/platform-server": "5.0.3",
5151
"@types/jasmine": "2.8.0",
5252
"@types/jasminewd2": "2.0.3",
5353
"codelyzer": "4.0.1",

src/app/materialPage/materialPage.component.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { PizzaComponent } from './pizza/pizza.component';
22
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
33
import { MatSnackBar } from '@angular/material';
4+
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
45

56
import {
67
CdkTableModule,
@@ -18,6 +19,7 @@ import { Observable } from 'rxjs/Observable';
1819
})
1920
export class MaterialPageComponent {
2021

22+
2123
/** List of columns for the CDK and Material table. */
2224
tableColumns = ['userId'];
2325

@@ -34,7 +36,18 @@ export class MaterialPageComponent {
3436
'test2'
3537
];
3638

37-
constructor(public snackBar: MatSnackBar) {
39+
constructor(public snackBar: MatSnackBar, breakpointObserver: BreakpointObserver) {
40+
breakpointObserver.observe([
41+
Breakpoints.HandsetLandscape,
42+
Breakpoints.HandsetPortrait
43+
]).subscribe(result => {
44+
if (result.matches) {
45+
this.activateHandsetLayout();
46+
}
47+
});
48+
}
49+
50+
activateHandsetLayout(): any {
3851
}
3952

4053
openSnackBar() {

src/app/materialPage/materialPage.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { Component, NgModule } from '@angular/core';
55
import { ServerModule } from '@angular/platform-server';
66
import { BrowserModule } from '@angular/platform-browser';
77
import { Observable } from 'rxjs/Observable';
8+
import {LayoutModule} from '@angular/cdk/layout';
9+
810
import {
911
MatAutocompleteModule,
1012
MatButtonModule,
@@ -48,6 +50,7 @@ import { PizzaComponent } from './pizza/pizza.component';
4850
@NgModule({
4951
imports: [
5052
CommonModule,
53+
LayoutModule,
5154
MaterialPageRoutes,
5255
MatAutocompleteModule,
5356
MatButtonModule,

0 commit comments

Comments
 (0)