From 8e4c5bc4db407d3ba791decf890ac924a3d5c214 Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Thu, 3 Nov 2016 16:35:34 -0700 Subject: [PATCH 1/3] use experimental alpha 10 --- package.json | 4 +- src/app/app.component.html | 216 ++++++++++++++++++------------------- 2 files changed, 110 insertions(+), 110 deletions(-) diff --git a/package.json b/package.json index 968c179..538c400 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@angular/http": "^2.0.0", "@angular/platform-browser": "^2.0.0", "@angular/platform-browser-dynamic": "^2.0.0", - "@angular/material": "2.0.0-alpha.9-3", + "@angular/material": "2.0.0-alpha.10-experimental-yogurt", "@angular/router": "^3.0.0", "core-js": "^2.4.0", "rxjs": "5.0.0-beta.12", @@ -27,7 +27,7 @@ "zone.js": "^0.6.21" }, "devDependencies": { - "@angular/compiler-cli": "^0.6.3", + "@angular/compiler-cli": "^2.0.0", "@angular/platform-server": "^2.0.0", "@types/hammerjs": "^2.0.32", "@types/jasmine": "^2.2.30", diff --git a/src/app/app.component.html b/src/app/app.component.html index 0424b95..a9013c4 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -17,114 +17,114 @@
- - - - - - - - - Unchecked - Checked - Indeterminate - Disabled - - - - Alpha - Beta - Gamma - - - - - - - - {{nickname.characterCount}} / 50 - - - - - - android Favorite phone - - - - - - motorcycle -   - - - - - - - -

{{food.name}}

-

{{food.rating}}

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - build - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From da035f2bb3d1cf6534cffe1ef9dcd5ae1f1ca109 Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Wed, 9 Nov 2016 13:33:51 -0800 Subject: [PATCH 2/3] exerpiemtnal --- package.json | 2 +- src/app/app.component.html | 205 ++++++++++++++++++------------------- 2 files changed, 98 insertions(+), 109 deletions(-) diff --git a/package.json b/package.json index 538c400..bad20e6 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@angular/http": "^2.0.0", "@angular/platform-browser": "^2.0.0", "@angular/platform-browser-dynamic": "^2.0.0", - "@angular/material": "2.0.0-alpha.10-experimental-yogurt", + "@angular/material": "2.0.0-alpha.10-experimental-coffee", "@angular/router": "^3.0.0", "core-js": "^2.4.0", "rxjs": "5.0.0-beta.12", diff --git a/src/app/app.component.html b/src/app/app.component.html index a9013c4..7c96be1 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -17,114 +17,103 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + Unchecked + Checked + Indeterminate + Disabled + + + + Alpha + Beta + Gamma + + + + + + + + {{nickname.characterCount}} / 50 + + + + + + android Favorite phone + + + + + + motorcycle +   + + + + + + + +

{{food.name}}

+

{{food.rating}}

+
+
+
+ + + + + + + + + + + + + + + +

EARTH

+
+ +

FIRE

+
+
+
+ + + build + + + + + From 010f7509e2b5fc63be8d29b8900b3562e73f9f5b Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Wed, 9 Nov 2016 18:36:20 -0800 Subject: [PATCH 3/3] stuff --- package.json | 2 +- src/app/app.component.html | 6 ++++++ src/app/app.component.ts | 35 +++++++++++++++++++++++++++++++++-- src/app/app.module.ts | 5 +++-- 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index bad20e6..a8a9fca 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@angular/http": "^2.0.0", "@angular/platform-browser": "^2.0.0", "@angular/platform-browser-dynamic": "^2.0.0", - "@angular/material": "2.0.0-alpha.10-experimental-coffee", + "@angular/material": "2.0.0-alpha.10", "@angular/router": "^3.0.0", "core-js": "^2.4.0", "rxjs": "5.0.0-beta.12", diff --git a/src/app/app.component.html b/src/app/app.component.html index 7c96be1..8ff8b53 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -121,6 +121,12 @@

{{food.name}}

+ +

Last dialog result: {{lastDialogResult}}

+ + +
+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e90817c..2b8e45b 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,4 +1,5 @@ -import {Component} from '@angular/core'; +import {Component, Optional} from '@angular/core'; +import {MdDialog, MdDialogRef, MdSnackBar} from '@angular/material'; @Component({ @@ -8,6 +9,7 @@ import {Component} from '@angular/core'; }) export class Material2AppAppComponent { isDarkTheme: boolean = false; + lastDialogResult: string; foods: any[] = [ {name: 'Pizza', rating: 'Excellent'}, @@ -17,10 +19,39 @@ export class Material2AppAppComponent { progress: number = 0; - constructor() { + constructor(private _dialog: MdDialog, private _snackbar: MdSnackBar) { // Update the value for the progress-bar on an interval. setInterval(() => { this.progress = (this.progress + Math.floor(Math.random() * 4) + 1) % 100; }, 200); } + + openDialog() { + let dialogRef = this._dialog.open(DialogContent); + + dialogRef.afterClosed().subscribe(result => { + this.lastDialogResult = result; + }) + } + + showSnackbar() { + this._snackbar.open('YUM SNACKS', 'CHEW'); + } +} + + +@Component({ + template: ` +

This is a dialog

+

+ +

+

+ `, +}) +export class DialogContent { + constructor(@Optional() public dialogRef: MdDialogRef) { } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 435d3ef..8f52970 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,14 +1,15 @@ import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {MaterialModule} from '@angular/material'; -import {Material2AppAppComponent} from './app.component'; +import {Material2AppAppComponent, DialogContent} from './app.component'; @NgModule({ imports: [ BrowserModule, MaterialModule.forRoot(), ], - declarations: [Material2AppAppComponent], + declarations: [Material2AppAppComponent, DialogContent], + entryComponents: [DialogContent], bootstrap: [Material2AppAppComponent], }) export class MaterialAppModule { }