Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular - Aligning Related Dependencies for NPM (abp) #21384

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion npm/ng-packs/packages/components/page/src/page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export class PageComponent {
this.breadcrumb ||
this.customTitle ||
this.customBreadcrumb ||
this.customToolbar
this.customToolbar ||
this.pageParts
);
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { BehaviorSubject, Observable } from 'rxjs';
import { NavItem } from '../models/nav-item';
import { inject, Type } from '@angular/core';
import { SORT_COMPARE_FUNC } from '@abp/ng.core';
import { SORT_COMPARE_FUNC, SortableItem } from '@abp/ng.core';

export abstract class AbstractMenuService<T extends NavItem> {
protected abstract baseClass: Type<any>;

protected readonly sortFn = inject(SORT_COMPARE_FUNC);
protected readonly sortFn: (a: SortableItem, b: SortableItem) => number;

protected _items$ = new BehaviorSubject<T[]>([]);

Expand All @@ -18,6 +18,10 @@ export abstract class AbstractMenuService<T extends NavItem> {
return this._items$.asObservable();
}

constructor() {
this.sortFn = inject(SORT_COMPARE_FUNC);
}

addItems(newItems: T[]) {
const items = [...this.items];
newItems.forEach(item => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
PROJECTION_STRATEGY,
Strict,
} from '@abp/ng.core';
import { ComponentRef, Injectable } from '@angular/core';
import { ComponentRef, inject, Injectable } from '@angular/core';
import { ReplaySubject } from 'rxjs';
import { ToastContainerComponent } from '../components/toast-container/toast-container.component';
import { Toaster } from '../models';
Expand All @@ -20,8 +20,7 @@ export class ToasterService implements ToasterContract {
private toasts = [] as Toaster.Toast[];

private containerComponentRef!: ComponentRef<ToastContainerComponent>;

constructor(private contentProjectionService: ContentProjectionService) {}
private contentProjectionService: ContentProjectionService;

private setContainer() {
this.containerComponentRef = this.contentProjectionService.projectContent(
Expand All @@ -34,6 +33,10 @@ export class ToasterService implements ToasterContract {
this.containerComponentRef.changeDetectorRef.detectChanges();
}

constructor() {
this.contentProjectionService = inject(ContentProjectionService);
}

/**
* Creates an info toast with given parameters.
* @param message Content of the toast
Expand Down
Loading