mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 04:25:08 +00:00
(FuseNavigation) Merge the subscriptions
(FuseNavigationDocs) Updated the docs
This commit is contained in:
parent
ab7bd882a0
commit
8961d75241
|
@ -1,5 +1,5 @@
|
||||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { Subject } from 'rxjs';
|
import { merge, Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
||||||
|
@ -60,27 +60,12 @@ export class FuseNavigationComponent implements OnInit
|
||||||
this._changeDetectorRef.markForCheck();
|
this._changeDetectorRef.markForCheck();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Subscribe to navigation item additions
|
// Subscribe to navigation item
|
||||||
this._fuseNavigationService.onNavigationItemAdded
|
merge(
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
this._fuseNavigationService.onNavigationItemAdded,
|
||||||
.subscribe(() => {
|
this._fuseNavigationService.onNavigationItemUpdated,
|
||||||
|
|
||||||
// Mark for check
|
|
||||||
this._changeDetectorRef.markForCheck();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Subscribe to navigation item updates
|
|
||||||
this._fuseNavigationService.onNavigationItemUpdated
|
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
|
||||||
.subscribe(() => {
|
|
||||||
|
|
||||||
// Mark for check
|
|
||||||
this._changeDetectorRef.markForCheck();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Subscribe to navigation item removal
|
|
||||||
this._fuseNavigationService.onNavigationItemRemoved
|
this._fuseNavigationService.onNavigationItemRemoved
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
).pipe(takeUntil(this._unsubscribeAll))
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
|
|
||||||
// Mark for check
|
// Mark for check
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ChangeDetectorRef, Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core';
|
import { ChangeDetectorRef, Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { NavigationEnd, Router } from '@angular/router';
|
import { NavigationEnd, Router } from '@angular/router';
|
||||||
import { Subject } from 'rxjs';
|
import { merge, Subject } from 'rxjs';
|
||||||
import { filter, takeUntil } from 'rxjs/operators';
|
import { filter, takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
import { FuseNavigationItem } from '@fuse/types';
|
import { FuseNavigationItem } from '@fuse/types';
|
||||||
|
@ -114,27 +114,12 @@ export class FuseNavVerticalCollapsableComponent implements OnInit, OnDestroy
|
||||||
this.collapse();
|
this.collapse();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Subscribe to navigation item additions
|
// Subscribe to navigation item
|
||||||
this._fuseNavigationService.onNavigationItemAdded
|
merge(
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
this._fuseNavigationService.onNavigationItemAdded,
|
||||||
.subscribe(() => {
|
this._fuseNavigationService.onNavigationItemUpdated,
|
||||||
|
|
||||||
// Mark for check
|
|
||||||
this._changeDetectorRef.markForCheck();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Subscribe to navigation item updates
|
|
||||||
this._fuseNavigationService.onNavigationItemUpdated
|
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
|
||||||
.subscribe(() => {
|
|
||||||
|
|
||||||
// Mark for check
|
|
||||||
this._changeDetectorRef.markForCheck();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Subscribe to navigation item removal
|
|
||||||
this._fuseNavigationService.onNavigationItemRemoved
|
this._fuseNavigationService.onNavigationItemRemoved
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
).pipe(takeUntil(this._unsubscribeAll))
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
|
|
||||||
// Mark for check
|
// Mark for check
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { ChangeDetectorRef, Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core';
|
import { ChangeDetectorRef, Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { Subject } from 'rxjs';
|
import { merge, Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
import { FuseNavigationItem } from '@fuse/types';
|
import { FuseNavigationItem } from '@fuse/types';
|
||||||
|
@ -48,27 +48,12 @@ export class FuseNavVerticalGroupComponent implements OnInit, OnDestroy
|
||||||
*/
|
*/
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// Subscribe to navigation item additions
|
// Subscribe to navigation item
|
||||||
this._fuseNavigationService.onNavigationItemAdded
|
merge(
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
this._fuseNavigationService.onNavigationItemAdded,
|
||||||
.subscribe(() => {
|
this._fuseNavigationService.onNavigationItemUpdated,
|
||||||
|
|
||||||
// Mark for check
|
|
||||||
this._changeDetectorRef.markForCheck();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Subscribe to navigation item updates
|
|
||||||
this._fuseNavigationService.onNavigationItemUpdated
|
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
|
||||||
.subscribe(() => {
|
|
||||||
|
|
||||||
// Mark for check
|
|
||||||
this._changeDetectorRef.markForCheck();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Subscribe to navigation item removal
|
|
||||||
this._fuseNavigationService.onNavigationItemRemoved
|
this._fuseNavigationService.onNavigationItemRemoved
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
).pipe(takeUntil(this._unsubscribeAll))
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
|
|
||||||
// Mark for check
|
// Mark for check
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { ChangeDetectorRef, Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core';
|
import { ChangeDetectorRef, Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { Subject } from 'rxjs';
|
import { merge, Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
import { FuseNavigationItem } from '@fuse/types';
|
import { FuseNavigationItem } from '@fuse/types';
|
||||||
|
@ -48,27 +48,12 @@ export class FuseNavVerticalItemComponent implements OnInit, OnDestroy
|
||||||
*/
|
*/
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// Subscribe to navigation item additions
|
// Subscribe to navigation item
|
||||||
this._fuseNavigationService.onNavigationItemAdded
|
merge(
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
this._fuseNavigationService.onNavigationItemAdded,
|
||||||
.subscribe(() => {
|
this._fuseNavigationService.onNavigationItemUpdated,
|
||||||
|
|
||||||
// Mark for check
|
|
||||||
this._changeDetectorRef.markForCheck();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Subscribe to navigation item updates
|
|
||||||
this._fuseNavigationService.onNavigationItemUpdated
|
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
|
||||||
.subscribe(() => {
|
|
||||||
|
|
||||||
// Mark for check
|
|
||||||
this._changeDetectorRef.markForCheck();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Subscribe to navigation item removal
|
|
||||||
this._fuseNavigationService.onNavigationItemRemoved
|
this._fuseNavigationService.onNavigationItemRemoved
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
).pipe(takeUntil(this._unsubscribeAll))
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
|
|
||||||
// Mark for check
|
// Mark for check
|
||||||
|
|
|
@ -47,8 +47,10 @@ export class DocsComponentsNavigationComponent
|
||||||
updateMailBadge(): void
|
updateMailBadge(): void
|
||||||
{
|
{
|
||||||
// Update the badge title
|
// Update the badge title
|
||||||
this._fuseNavigationService.updateNavigationItem('02001', {
|
this._fuseNavigationService.updateNavigationItem('mail', {
|
||||||
title: 'Transactionssss'
|
badge: {
|
||||||
|
title: 35
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user