Skip to content

Commit 33a5b84

Browse files
Merge pull request #249 from angular/main
Create a new pull request by comparing changes across two branches
2 parents 6b2cbd9 + d9707e1 commit 33a5b84

File tree

78 files changed

+105
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+105
-173
lines changed

.pullapprove.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
version: 3
5858

5959
availability:
60-
users_unavailable: ['atscott', 'devversion']
60+
users_unavailable: ['atscott']
6161

6262
# Meta field that goes unused by PullApprove to allow for defining aliases to be
6363
# used throughout the config.

adev/shared-docs/components/algolia-icon/algolia-icon.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {ChangeDetectionStrategy, Component} from '@angular/core';
1111
@Component({
1212
selector: 'docs-algolia-icon',
1313
changeDetection: ChangeDetectionStrategy.OnPush,
14-
imports: [],
1514
templateUrl: './algolia-icon.component.html',
1615
})
1716
export class AlgoliaIcon {}

adev/shared-docs/components/breadcrumb/breadcrumb.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@for (breadcrumb of breadcrumbItems(); track breadcrumb) {
1+
@for (breadcrumb of breadcrumbItems(); track $index) {
22
<div class="docs-breadcrumb">
33
@if (breadcrumb.path) {
44
@if (breadcrumb.isExternal) {

adev/shared-docs/components/breadcrumb/breadcrumb.component.ts

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import {ChangeDetectionStrategy, Component, OnInit, inject, signal} from '@angular/core';
9+
import {ChangeDetectionStrategy, Component, inject, computed} from '@angular/core';
1010
import {NavigationState} from '../../services/index';
1111
import {NavigationItem} from '../../interfaces/index';
1212
import {RouterLink} from '@angular/router';
@@ -18,31 +18,18 @@ import {RouterLink} from '@angular/router';
1818
styleUrls: ['./breadcrumb.component.scss'],
1919
changeDetection: ChangeDetectionStrategy.OnPush,
2020
})
21-
export class Breadcrumb implements OnInit {
21+
export class Breadcrumb {
2222
private readonly navigationState = inject(NavigationState);
2323

24-
breadcrumbItems = signal<NavigationItem[]>([]);
24+
breadcrumbItems = computed(() => {
25+
const breadcrumbs: NavigationItem[] = [];
26+
let activeItem = this.navigationState.activeNavigationItem()?.parent;
2527

26-
ngOnInit(): void {
27-
this.setBreadcrumbItemsBasedOnNavigationStructure();
28-
}
28+
while (activeItem != null) {
29+
breadcrumbs.push(activeItem);
30+
activeItem = activeItem.parent;
31+
}
2932

30-
private setBreadcrumbItemsBasedOnNavigationStructure(): void {
31-
let breadcrumbs: NavigationItem[] = [];
32-
33-
const traverse = (node: NavigationItem | null) => {
34-
if (!node) {
35-
return;
36-
}
37-
38-
if (node.parent) {
39-
breadcrumbs = [node.parent, ...breadcrumbs];
40-
traverse(node.parent);
41-
}
42-
};
43-
44-
traverse(this.navigationState.activeNavigationItem());
45-
46-
this.breadcrumbItems.set(breadcrumbs);
47-
}
33+
return breadcrumbs.reverse();
34+
});
4835
}

adev/shared-docs/components/icon/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
load("//tools:defaults.bzl", "ng_module")
21
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
2+
load("//tools:defaults.bzl", "ng_module")
33

44
package(default_visibility = ["//visibility:private"])
55

@@ -10,7 +10,6 @@ ng_module(
1010
],
1111
assets = [
1212
":icon.component.css",
13-
"icon.component.html",
1413
],
1514
visibility = [
1615
"//adev/shared-docs/components:__pkg__",

adev/shared-docs/components/icon/icon.component.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

adev/shared-docs/components/icon/icon.component.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,21 @@ import {
1818

1919
@Component({
2020
selector: 'docs-icon',
21-
templateUrl: './icon.component.html',
22-
styleUrl: './icon.component.scss',
21+
changeDetection: ChangeDetectionStrategy.OnPush,
2322
host: {
24-
'[class]': 'MATERIAL_SYMBOLS_OUTLINED',
23+
'class': 'material-symbols-outlined',
2524
'[style.font-size.px]': 'fontSize()',
2625
'aria-hidden': 'true',
2726
'translate': 'no',
2827
},
29-
changeDetection: ChangeDetectionStrategy.OnPush,
28+
template: '<ng-content />',
29+
styleUrl: './icon.component.scss',
3030
})
3131
export class IconComponent {
32-
fontSize = computed(() => {
33-
return IconComponent.isFontLoaded() ? null : 0;
34-
});
32+
private static isFontLoaded = signal(false);
3533

36-
protected readonly MATERIAL_SYMBOLS_OUTLINED = 'material-symbols-outlined';
34+
protected readonly fontSize = computed(() => (IconComponent.isFontLoaded() ? null : 0));
3735

38-
private static isFontLoaded = signal(false);
3936
/** Share the same promise across different instances of the component */
4037
private static whenFontLoad?: Promise<FontFace[]> | undefined;
4138

adev/shared-docs/components/viewers/docs-viewer/docs-viewer.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export class DocViewer implements OnChanges {
7979
private readonly injector = inject(Injector);
8080
private readonly appRef = inject(ApplicationRef);
8181

82-
// tslint:disable-next-line:no-unused-variable
8382
private animateContent = false;
8483
private readonly pendingTasks = inject(PendingTasks);
8584

adev/src/app/app-scroller.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
ApplicationRef,
1313
afterNextRender,
1414
EnvironmentInjector,
15+
Injector,
1516
} from '@angular/core';
1617
import {Scroll, Router} from '@angular/router';
1718
import {filter, firstValueFrom, map, switchMap, tap} from 'rxjs';
@@ -62,7 +63,7 @@ export class AppScroller {
6263
});
6364
}
6465

65-
scroll() {
66+
scroll(injector?: Injector) {
6667
if (!this._lastScrollEvent || !this.canScroll) {
6768
return;
6869
}
@@ -83,7 +84,9 @@ export class AppScroller {
8384
}
8485
},
8586
},
86-
{injector: this.injector},
87+
// Use the component injector when provided so that the manager can
88+
// deregister the sequence once the component is destroyed.
89+
{injector: injector ?? this.injector},
8790
);
8891
this.cancelScroll = () => {
8992
ref.destroy();

adev/src/app/editor/code-editor/code-mirror-editor.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ export class CodeMirrorEditor {
220220
if (!this.currentFile().filename.endsWith('.ts')) return;
221221

222222
this.tsVfsWorker.postMessage(request);
223-
// tslint:disable-next-line:semicolon
224223
};
225224

226225
private getVfsEnvFileSystemMap(): Map<string, string> {

0 commit comments

Comments
 (0)