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

Commit d64fb9c

Browse files
committed
refactor: convert app to latest Angular CLI format
fix some Ivy and TypeScript compilation and configuration issues add a `build:highmem` for use when the build fails due to memory usage update all dependencies that are supported remove unneeded polyfills now that differential loading is supported convert workspace to current format move and update tsconfigs to match current CLI format log errors on bootstrap enable some router quality of life options add a `Version` interface update StackBlitz - Copyright - major Angular version - dependencies fix build error for `setTimeout` - it was resolving to the NodeJS version rather than DOM version
1 parent af6cce7 commit d64fb9c

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

src/app/pages/component-sidenav/component-sidenav.spec.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
2-
import {MatSidenav} from '@angular/material/sidenav';
32
import {take} from 'rxjs/operators';
43
import {ComponentSidenav, ComponentSidenavModule} from './component-sidenav';
54
import {DocsAppTestingModule} from '../../testing/testing-module';
5+
import {MatSidenav} from '@angular/material/sidenav';
66

77
describe('ComponentSidenav', () => {
88
let fixture: ComponentFixture<ComponentSidenav>;
9+
let component: ComponentSidenav;
910

1011
beforeEach(async(() => {
1112
TestBed.configureTestingModule({
@@ -15,17 +16,17 @@ describe('ComponentSidenav', () => {
1516

1617
beforeEach(() => {
1718
fixture = TestBed.createComponent(ComponentSidenav);
19+
component = fixture.componentInstance;
20+
fixture.detectChanges();
1821
});
1922

2023
it('should close the sidenav on init', () => {
21-
const component = fixture.componentInstance;
22-
2324
// Spy on window.mediaMatch and return stub
2425
spyOn(window, 'matchMedia').and.returnValue({
2526
matches: true
2627
} as any);
2728

28-
fixture.detectChanges();
29+
// TODO refactor this as none of these expectations are ever verified
2930
async(() => {
3031
expect(component.sidenav instanceof MatSidenav).toBeTruthy();
3132
component.isScreenSmall.pipe(take(1)).subscribe(isSmall => expect(isSmall).toBeTruthy());
@@ -34,10 +35,6 @@ describe('ComponentSidenav', () => {
3435
});
3536

3637
it('should show a link for each item in doc items categories', () => {
37-
const component = fixture.componentInstance;
38-
39-
fixture.detectChanges();
40-
4138
const totalItems = component.docItems.getItems('categories').length;
4239
const totalLinks = fixture
4340
.nativeElement

src/app/pages/component-sidenav/component-sidenav.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const SMALL_WIDTH_BREAKPOINT = 720;
2424
encapsulation: ViewEncapsulation.None,
2525
})
2626
export class ComponentSidenav implements OnInit {
27+
@ViewChild(MatSidenav, {static: false}) sidenav: MatSidenav;
2728
params: Observable<Params>;
2829
isScreenSmall: Observable<boolean>;
2930

@@ -35,15 +36,12 @@ export class ComponentSidenav implements OnInit {
3536
.pipe(map(breakpoint => breakpoint.matches));
3637
}
3738

38-
@ViewChild(MatSidenav, {static: false}) sidenav: MatSidenav;
39-
4039
ngOnInit() {
4140
// Combine params from all of the path into a single object.
4241
this.params = combineLatest(
4342
this._route.pathFromRoot.map(route => route.params),
4443
Object.assign);
4544
}
46-
4745
}
4846

4947
@Component({

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ describe('StackblitzWriter', () => {
3232
it('should append correct copyright', () => {
3333
expect(stackblitzWriter._appendCopyright('test.ts', 'NoContent')).toBe(`NoContent
3434
35-
/** Copyright 2019 Google Inc. All Rights Reserved.
35+
/** Copyright 2019 Google LLC. All Rights Reserved.
3636
Use of this source code is governed by an MIT-style license that
3737
can be found in the LICENSE file at http://angular.io/license */`);
3838

3939
expect(stackblitzWriter._appendCopyright('test.html', 'NoContent')).toBe(`NoContent
4040
41-
<!-- Copyright 2019 Google Inc. All Rights Reserved.
41+
<!-- Copyright 2019 Google LLC. All Rights Reserved.
4242
Use of this source code is governed by an MIT-style license that
4343
can be found in the LICENSE file at http://angular.io/license -->`);
4444

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@
204204
dependencies:
205205
tslib "^1.9.0"
206206

207-
"@angular/material-examples@angular/material2-docs-content":
208-
version "8.2.0-17f2546"
209-
resolved "https://codeload.github.com/angular/material2-docs-content/tar.gz/5cb1cbc82959dd71d3e41013ab44e0a007e43084"
207+
"@angular/material-examples@angular/material2-docs-content#8.1.x":
208+
version "8.1.4-4eec07d"
209+
resolved "https://codeload.github.com/angular/material2-docs-content/tar.gz/7b223fbc784d9812f9c7ef523e5332cf5ba91d5d"
210210
dependencies:
211211
tslib "^1.7.1"
212212

0 commit comments

Comments
 (0)