mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
Migrate to @angular-eslint/prefer-inject and @typescript-eslint/prefer-readonly (#11665)
This commit is contained in:
@@ -28,7 +28,8 @@ import {
|
||||
QueryList,
|
||||
SimpleChanges,
|
||||
TemplateRef,
|
||||
ViewChildren
|
||||
ViewChildren,
|
||||
inject
|
||||
} from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
@@ -46,6 +47,8 @@ import { IconModule } from '@alfresco/adf-core';
|
||||
imports: [CommonModule, IconModule, TranslatePipe, MatButtonModule, BreadcrumbFocusDirective]
|
||||
})
|
||||
export class BreadcrumbComponent implements AfterContentInit, OnChanges {
|
||||
private readonly cdr = inject(ChangeDetectorRef);
|
||||
|
||||
private _breadcrumbTemplateRefs: Array<TemplateRef<unknown>> = [];
|
||||
|
||||
@Input()
|
||||
@@ -62,8 +65,6 @@ export class BreadcrumbComponent implements AfterContentInit, OnChanges {
|
||||
|
||||
selectedBreadcrumbs: Array<TemplateRef<unknown>> = [];
|
||||
|
||||
constructor(private cdr: ChangeDetectorRef) {}
|
||||
|
||||
ngAfterContentInit() {
|
||||
this.breadcrumbItems.changes
|
||||
.pipe(
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Directive, ElementRef } from '@angular/core';
|
||||
import { Directive, ElementRef, inject } from '@angular/core';
|
||||
|
||||
/** @internal */
|
||||
@Directive({
|
||||
@@ -26,7 +26,7 @@ import { Directive, ElementRef } from '@angular/core';
|
||||
}
|
||||
})
|
||||
export class BreadcrumbFocusDirective {
|
||||
constructor(private elementRef: ElementRef) {}
|
||||
private readonly elementRef = inject(ElementRef);
|
||||
|
||||
focusOnFirstFocusableElement() {
|
||||
this.getFocusableElements(this.elementRef.nativeElement)[0].focus();
|
||||
|
||||
Reference in New Issue
Block a user