Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit cc41474

Browse files
authored
Update to Angular Material beta.3 (#143)
1 parent 2e3c7ab commit cc41474

21 files changed

+120
-28
lines changed

package.json

+14-13
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,23 @@
1616
},
1717
"private": true,
1818
"dependencies": {
19-
"@angular/common": "^2.4.6",
20-
"@angular/compiler": "^2.4.6",
21-
"@angular/core": "^2.4.6",
22-
"@angular/forms": "^2.4.6",
23-
"@angular/http": "^2.4.6",
24-
"@angular/material": "^2.0.0-beta.1",
25-
"@angular/platform-browser": "^2.4.6",
26-
"@angular/platform-browser-dynamic": "^2.4.6",
27-
"@angular/router": "~3.4.6",
19+
"@angular/animations": "^4.0.0",
20+
"@angular/common": "^4.0.0",
21+
"@angular/compiler": "^4.0.0",
22+
"@angular/core": "^4.0.0",
23+
"@angular/forms": "^4.0.0",
24+
"@angular/http": "^4.0.0",
25+
"@angular/material": "^2.0.0-beta.3",
26+
"@angular/platform-browser": "^4.0.0",
27+
"@angular/platform-browser-dynamic": "^4.0.0",
28+
"@angular/router": "~4.0.0",
2829
"core-js": "^2.4.1",
2930
"rxjs": "^5.1.0",
30-
"zone.js": "^0.7.6"
31+
"zone.js": "^0.7.7"
3132
},
3233
"devDependencies": {
33-
"@angular/cli": "^1.0.0-beta.30",
34-
"@angular/compiler-cli": "^2.4.6",
34+
"@angular/cli": "^1.0.0",
35+
"@angular/compiler-cli": "^4.0.0",
3536
"@types/jasmine": "^2.5.41",
3637
"@types/node": "^7.0.5",
3738
"highlight.js": "^9.9.0",
@@ -46,6 +47,6 @@
4647
"protractor": "^5.1.1",
4748
"ts-node": "^2.0.0",
4849
"tslint": "^4.4.2",
49-
"typescript": "~2.0.10"
50+
"typescript": "~2.1.1"
5051
}
5152
}

src/_app-theme.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '~@angular/material/core/theming/theming';
1+
@import '~@angular/material/theming';
22
@import './app/pages/homepage/homepage-theme';
33
@import './app/pages/component-sidenav/component-sidenav-theme';
44
@import './app/pages/component-viewer/component-viewer-theme';

src/app/app-module.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {BrowserModule} from '@angular/platform-browser';
2+
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
23
import {NgModule} from '@angular/core';
34
import {Location, LocationStrategy, PathLocationStrategy} from '@angular/common';
45
import {FormsModule} from '@angular/forms';
@@ -35,6 +36,7 @@ import {ComponentPageHeader} from './pages/component-page-header/component-page-
3536
],
3637
imports: [
3738
BrowserModule,
39+
BrowserAnimationsModule,
3840
ExampleModule,
3941
SharedModule,
4042
FormsModule,

src/app/examples/progress-spinner-configurable/progress-spinner-configurable-example.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ <h2 class="example-h2">Progress circle configuration</h2>
3939
<md-card-content>
4040
<h2 class="example-h2">Result</h2>
4141

42-
<md-progress-circle
42+
<md-progress-spinner
4343
class="example-margin"
4444
[color]="color"
4545
[mode]="mode"
4646
[value]="value">
47-
</md-progress-circle>
47+
</md-progress-spinner>
4848
</md-card-content>
4949
</md-card>

src/app/material-docs-app.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component, ViewEncapsulation} from '@angular/core';
2-
import {Router} from '@angular/router';
2+
import {Router, NavigationStart} from '@angular/router';
33

44

55
@Component({
@@ -16,7 +16,7 @@ export class MaterialDocsApp {
1616
showShadow = false;
1717

1818
constructor(router: Router) {
19-
router.events.subscribe(data => {
19+
router.events.subscribe((data: NavigationStart) => {
2020
this.showShadow = data.url.startsWith('/components');
2121
});
2222
}

src/app/pages/component-list/component-list.scss

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@import '~@angular/material/button/button-base';
21
@import '../../../styles/constants';
32

43
.docs-component-list-category {

src/app/pages/component-sidenav/_component-sidenav-theme.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '~@angular/material/core/theming/theming';
1+
@import '~@angular/material/theming';
22

33
@mixin component-viewer-sidenav-theme($theme) {
44
$primary: map-get($theme, primary);

src/app/pages/component-viewer/_component-viewer-theme.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '~@angular/material/core/theming/theming';
1+
@import '~@angular/material/theming';
22

33
@mixin component-viewer-theme($theme) {
44
$primary: map-get($theme, primary);

src/app/pages/guide-viewer/guide-viewer.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "~@angular/material/core/style/variables";
1+
@import "~@angular/material/theming";
22

33
/* For desktop, the content should be aligned with the page title. */
44
$guide-content-margin-side: 70px;

src/app/shared/example-viewer/example-viewer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
</div>
2727

2828
<div class="docs-example-viewer-body">
29-
<template [portalHost]="selectedPortal"></template>
29+
<ng-template [portalHost]="selectedPortal"></ng-template>
3030
</div>
3131
</div>

src/assets/plunker/examples/autocomplete-overview/autocomplete-overview-example.css

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<md-input-container>
2+
<input mdInput placeholder="State" [mdAutocomplete]="auto" [formControl]="stateCtrl">
3+
</md-input-container>
4+
5+
<md-autocomplete #auto="mdAutocomplete">
6+
<md-option *ngFor="let state of filteredStates | async" [value]="state">
7+
{{ state }}
8+
</md-option>
9+
</md-autocomplete>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import {Component} from '@angular/core';
2+
import {FormControl} from '@angular/forms';
3+
import 'rxjs/add/operator/startWith';
4+
5+
@Component({
6+
selector: 'autocomplete-overview-example',
7+
templateUrl: './autocomplete-overview-example.html',
8+
})
9+
export class AutocompleteOverviewExample {
10+
stateCtrl: FormControl;
11+
filteredStates: any;
12+
13+
states = [
14+
'Alabama',
15+
'Alaska',
16+
'Arizona',
17+
'Arkansas',
18+
'California',
19+
'Colorado',
20+
'Connecticut',
21+
'Delaware',
22+
'Florida',
23+
'Georgia',
24+
'Hawaii',
25+
'Idaho',
26+
'Illinois',
27+
'Indiana',
28+
'Iowa',
29+
'Kansas',
30+
'Kentucky',
31+
'Louisiana',
32+
'Maine',
33+
'Maryland',
34+
'Massachusetts',
35+
'Michigan',
36+
'Minnesota',
37+
'Mississippi',
38+
'Missouri',
39+
'Montana',
40+
'Nebraska',
41+
'Nevada',
42+
'New Hampshire',
43+
'New Jersey',
44+
'New Mexico',
45+
'New York',
46+
'North Carolina',
47+
'North Dakota',
48+
'Ohio',
49+
'Oklahoma',
50+
'Oregon',
51+
'Pennsylvania',
52+
'Rhode Island',
53+
'South Carolina',
54+
'South Dakota',
55+
'Tennessee',
56+
'Texas',
57+
'Utah',
58+
'Vermont',
59+
'Virginia',
60+
'Washington',
61+
'West Virginia',
62+
'Wisconsin',
63+
'Wyoming',
64+
];
65+
66+
constructor() {
67+
this.stateCtrl = new FormControl();
68+
this.filteredStates = this.stateCtrl.valueChanges
69+
.startWith(null)
70+
.map(name => this.filterStates(name));
71+
}
72+
73+
filterStates(val: string) {
74+
return val ? this.states.filter(s => new RegExp(`^${val}`, 'gi').test(s))
75+
: this.states;
76+
}
77+
78+
}

src/assets/plunker/examples/progress-spinner-configurable/progress-spinner-configurable-example.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ <h2 class="example-h2">Progress circle configuration</h2>
3939
<md-card-content>
4040
<h2 class="example-h2">Result</h2>
4141

42-
<md-progress-circle
42+
<md-progress-spinner
4343
class="example-margin"
4444
[color]="color"
4545
[mode]="mode"
4646
[value]="value">
47-
</md-progress-circle>
47+
</md-progress-spinner>
4848
</md-card-content>
4949
</md-card>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.example-pizza-party {
2+
color: hotpink;
3+
}

src/assets/plunker/examples/snack-bar-component/snack-bar-component-example.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ export class SnackBarComponentExample {
2020
@Component({
2121
selector: 'snack-bar-component-example-snack',
2222
templateUrl: './snack-bar-component-example-snack.html',
23-
styleUrls: ['./snack-bar-component-example-snack.css'],
23+
styleUrls: ['./snack-bar-component-example.css'],
2424
})
2525
export class PizzaPartyComponent {}

src/main.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '~@angular/material/core/theming/all-theme';
1+
@import '~@angular/material/theming';
22
@import './app-theme';
33
@import './styles/typography';
44

src/styles/_typography-theme.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '~@angular/material/core/theming/theming';
1+
@import '~@angular/material/theming';
22

33
@mixin docs-site-typography-theme($theme) {
44
$primary: map-get($theme, primary);

0 commit comments

Comments
 (0)