Browse Source

Merge pull request #21384 from abpframework/sumeyye-meetingNpmRulesForAbpPackages

Angular - Aligning Related Dependencies for NPM (abp)
pull/21431/head
Masum ULU 1 year ago
committed by GitHub
parent
commit
4e115317e5
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      npm/ng-packs/packages/components/page/src/page.component.ts
  2. 8
      npm/ng-packs/packages/theme-shared/src/lib/services/abstract-menu.service.ts
  3. 9
      npm/ng-packs/packages/theme-shared/src/lib/services/toaster.service.ts

3
npm/ng-packs/packages/components/page/src/page.component.ts

@ -45,7 +45,8 @@ export class PageComponent {
this.breadcrumb ||
this.customTitle ||
this.customBreadcrumb ||
this.customToolbar
this.customToolbar ||
this.pageParts
);
}
}

8
npm/ng-packs/packages/theme-shared/src/lib/services/abstract-menu.service.ts

@ -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[]>([]);
@ -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 => {

9
npm/ng-packs/packages/theme-shared/src/lib/services/toaster.service.ts

@ -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';
@ -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(
@ -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

Loading…
Cancel
Save