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

Commit d8939ac

Browse files
committed
fix: prepare for enabling Ivy (#642)
remove use of AsyncPipe with `*ngFor` - due to angular/angular#31371 remove deprecated `@angular/http` from StackBlitz dependencies remove out of date `.angular-cli.json` from StackBlitz templates - it's unclear that moving to the new `angular.json` format is viable remove unneeded polyfills from StackBlitz templates
1 parent 73e567a commit d8939ac

File tree

8 files changed

+19
-28
lines changed

8 files changed

+19
-28
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@
6565
"tslint": "^5.20.0",
6666
"typescript": "3.5.3"
6767
}
68-
}
68+
}

src/app/shared/stackblitz/stackblitz-writer.spec.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('StackblitzWriter', () => {
7474
}
7575
flushMicrotasks();
7676

77-
expect(form.elements.length).toBe(15);
77+
expect(form.elements.length).toBe(14);
7878

7979
// Should have correct tags
8080
expect(form.elements[0].getAttribute('name')).toBe('tags[0]');
@@ -94,12 +94,11 @@ describe('StackblitzWriter', () => {
9494
expect(form.elements[6].getAttribute('name')).toBe('files[index.html]');
9595
expect(form.elements[7].getAttribute('name')).toBe('files[styles.css]');
9696
expect(form.elements[8].getAttribute('name')).toBe('files[polyfills.ts]');
97-
expect(form.elements[9].getAttribute('name')).toBe('files[.angular-cli.json]');
98-
expect(form.elements[10].getAttribute('name')).toBe('files[main.ts]');
99-
expect(form.elements[11].getAttribute('name')).toBe('files[material-module.ts]');
100-
expect(form.elements[12].getAttribute('name')).toBe('files[app/test.ts]');
101-
expect(form.elements[13].getAttribute('name')).toBe('files[app/test.html]');
102-
expect(form.elements[14].getAttribute('name')).toBe('files[app/src/detail.ts]');
97+
expect(form.elements[9].getAttribute('name')).toBe('files[main.ts]');
98+
expect(form.elements[10].getAttribute('name')).toBe('files[material-module.ts]');
99+
expect(form.elements[11].getAttribute('name')).toBe('files[app/test.ts]');
100+
expect(form.elements[12].getAttribute('name')).toBe('files[app/test.html]');
101+
expect(form.elements[13].getAttribute('name')).toBe('files[app/src/detail.ts]');
103102
});
104103
}));
105104
});
@@ -114,7 +113,6 @@ const TEST_URLS = [
114113
'/assets/stackblitz/index.html',
115114
'/assets/stackblitz/styles.css',
116115
'/assets/stackblitz/polyfills.ts',
117-
'/assets/stackblitz/.angular-cli.json',
118116
'/assets/stackblitz/main.ts',
119117
'/assets/stackblitz/material-module.ts',
120118
'/docs-content/examples-source/test.ts',

src/app/shared/stackblitz/stackblitz-writer.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const TEMPLATE_FILES = [
2424
'index.html',
2525
'styles.css',
2626
'polyfills.ts',
27-
'.angular-cli.json',
2827
'main.ts',
2928
'material-module.ts',
3029
];
@@ -41,14 +40,12 @@ const dependencies = {
4140
'@angular/compiler': angularVersion,
4241
'@angular/core': angularVersion,
4342
'@angular/forms': angularVersion,
44-
'@angular/http': angularVersion,
4543
'@angular/platform-browser': angularVersion,
4644
'@angular/platform-browser-dynamic': angularVersion,
4745
'@angular/router': angularVersion,
4846
'angular-in-memory-web-api': '~0.5.4',
4947
'core-js': '^2.6.9',
5048
'rxjs': '>=6.5.3 <7.0.0',
51-
'web-animations-js': '^2.3.2',
5249
'zone.js': '^0.9.1',
5350
'hammerjs': '^2.0.8',
5451
'moment': '^2.24.0',

src/app/shared/version-picker/version-picker.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<mat-icon>arrow_drop_down</mat-icon>
44
</button>
55
<mat-menu #versionPicker="matMenu">
6-
<button mat-menu-item *ngFor="let version of docVersions | async"
6+
<button mat-menu-item *ngFor="let version of docVersions"
77
(click)="onVersionChanged(version)">
88
{{version.title}}
99
</button>

src/app/shared/version-picker/version-picker.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ export class VersionPicker {
1616
/** The currently running version of Material. */
1717
materialVersion = materialVersion;
1818
/** The possible versions of the doc site. */
19-
docVersions = this.http.get<VersionInfo[]>(versionUrl);
19+
docVersions: VersionInfo[];
2020

21-
constructor(private http: HttpClient) {}
21+
constructor(private http: HttpClient) {
22+
this.http.get<VersionInfo[]>(versionUrl)
23+
.subscribe((versions: VersionInfo[]) => this.docVersions = versions);
24+
}
2225

23-
/** Updates the window location if the selected version is a different version. */
26+
/**
27+
* Updates the window location if the selected version is a different version.
28+
* @param version data for use in navigating to the version's path
29+
*/
2430
onVersionChanged(version: VersionInfo) {
2531
if (!version.url.startsWith(window.location.href)) {
2632
window.location.assign(version.url);

src/assets/stackblitz/.angular-cli.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/assets/stackblitz/polyfills.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
import 'core-js/es6/reflect';
2-
import 'core-js/es7/reflect';
31
import 'zone.js/dist/zone';
42
import 'hammerjs';
5-
import 'web-animations-js';

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@
205205
tslib "^1.9.0"
206206

207207
"@angular/material-examples@angular/material2-docs-content":
208-
version "8.2.2-sha-fc6cb1069"
209-
resolved "https://codeload.github.com/angular/material2-docs-content/tar.gz/739fdda7e3fcdc507117001552ab32b63fe7e09a"
208+
version "8.2.2-sha-361d1cf80"
209+
resolved "https://codeload.github.com/angular/material2-docs-content/tar.gz/050aa5718e2a81f5ee6cbafd038eecaf55c95b6b"
210210
dependencies:
211211
tslib "^1.7.1"
212212

0 commit comments

Comments
 (0)