mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-08 19:45:08 +00:00
(FuseNavigation) Use the generic return type for "getComponent"
(docs) Updated FuseNavigation docs
This commit is contained in:
parent
c1ca701e92
commit
5c40e99518
|
@ -3,7 +3,7 @@ import { ActivatedRoute, Data, Router } from '@angular/router';
|
|||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { InitialData } from 'app/app.types';
|
||||
|
||||
@Component({
|
||||
|
@ -87,7 +87,7 @@ export class CenteredLayoutComponent implements OnInit, OnDestroy
|
|||
toggleNavigation(name: string): void
|
||||
{
|
||||
// Get the navigation
|
||||
const navigation = this._fuseNavigationService.getComponent(name);
|
||||
const navigation = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(name);
|
||||
|
||||
if ( navigation )
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ActivatedRoute, Data, Router } from '@angular/router';
|
|||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { InitialData } from 'app/app.types';
|
||||
|
||||
@Component({
|
||||
|
@ -87,7 +87,7 @@ export class EnterpriseLayoutComponent implements OnInit, OnDestroy
|
|||
toggleNavigation(name: string): void
|
||||
{
|
||||
// Get the navigation
|
||||
const navigation = this._fuseNavigationService.getComponent(name);
|
||||
const navigation = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(name);
|
||||
|
||||
if ( navigation )
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ActivatedRoute, Data, Router } from '@angular/router';
|
|||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { InitialData } from 'app/app.types';
|
||||
|
||||
@Component({
|
||||
|
@ -87,7 +87,7 @@ export class MaterialLayoutComponent implements OnInit, OnDestroy
|
|||
toggleNavigation(name: string): void
|
||||
{
|
||||
// Get the navigation
|
||||
const navigation = this._fuseNavigationService.getComponent(name);
|
||||
const navigation = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(name);
|
||||
|
||||
if ( navigation )
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ActivatedRoute, Data, Router } from '@angular/router';
|
|||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { InitialData } from 'app/app.types';
|
||||
|
||||
@Component({
|
||||
|
@ -87,7 +87,7 @@ export class ModernLayoutComponent implements OnInit, OnDestroy
|
|||
toggleNavigation(name: string): void
|
||||
{
|
||||
// Get the navigation
|
||||
const navigation = this._fuseNavigationService.getComponent(name);
|
||||
const navigation = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(name);
|
||||
|
||||
if ( navigation )
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ActivatedRoute, Data, Router } from '@angular/router';
|
|||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { InitialData } from 'app/app.types';
|
||||
|
||||
@Component({
|
||||
|
@ -87,7 +87,7 @@ export class ClassicLayoutComponent implements OnInit, OnDestroy
|
|||
toggleNavigation(name: string): void
|
||||
{
|
||||
// Get the navigation
|
||||
const navigation = this._fuseNavigationService.getComponent(name);
|
||||
const navigation = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(name);
|
||||
|
||||
if ( navigation )
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ActivatedRoute, Data, Router } from '@angular/router';
|
|||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { InitialData } from 'app/app.types';
|
||||
|
||||
@Component({
|
||||
|
@ -87,7 +87,7 @@ export class ClassyLayoutComponent implements OnInit, OnDestroy
|
|||
toggleNavigation(name: string): void
|
||||
{
|
||||
// Get the navigation
|
||||
const navigation = this._fuseNavigationService.getComponent(name);
|
||||
const navigation = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(name);
|
||||
|
||||
if ( navigation )
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ActivatedRoute, Data, Router } from '@angular/router';
|
|||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { InitialData } from 'app/app.types';
|
||||
|
||||
@Component({
|
||||
|
@ -87,7 +87,7 @@ export class CompactLayoutComponent implements OnInit, OnDestroy
|
|||
toggleNavigation(name: string): void
|
||||
{
|
||||
// Get the navigation
|
||||
const navigation = this._fuseNavigationService.getComponent(name);
|
||||
const navigation = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(name);
|
||||
|
||||
if ( navigation )
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ActivatedRoute, Data, Router } from '@angular/router';
|
|||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { InitialData } from 'app/app.types';
|
||||
|
||||
@Component({
|
||||
|
@ -88,7 +88,7 @@ export class DenseLayoutComponent implements OnInit, OnDestroy
|
|||
toggleNavigation(name: string): void
|
||||
{
|
||||
// Get the navigation
|
||||
const navigation = this._fuseNavigationService.getComponent(name);
|
||||
const navigation = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(name);
|
||||
|
||||
if ( navigation )
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ActivatedRoute, Data, Router } from '@angular/router';
|
|||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { InitialData } from 'app/app.types';
|
||||
|
||||
@Component({
|
||||
|
@ -87,7 +87,7 @@ export class FuturisticLayoutComponent implements OnInit, OnDestroy
|
|||
toggleNavigation(name: string): void
|
||||
{
|
||||
// Get the navigation
|
||||
const navigation = this._fuseNavigationService.getComponent(name);
|
||||
const navigation = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(name);
|
||||
|
||||
if ( navigation )
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ActivatedRoute, Data, Router } from '@angular/router';
|
|||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { InitialData } from 'app/app.types';
|
||||
|
||||
@Component({
|
||||
|
@ -87,7 +87,7 @@ export class ThinLayoutComponent implements OnInit, OnDestroy
|
|||
toggleNavigation(name: string): void
|
||||
{
|
||||
// Get the navigation
|
||||
const navigation = this._fuseNavigationService.getComponent(name);
|
||||
const navigation = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(name);
|
||||
|
||||
if ( navigation )
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
|||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { FuseNavigationItem, FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationItem, FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { MailboxService } from 'app/modules/admin/apps/mailbox/mailbox.service';
|
||||
import { MailboxComposeComponent } from 'app/modules/admin/apps/mailbox/compose/compose.component';
|
||||
import { labelColorDefs } from 'app/modules/admin/apps/mailbox/mailbox.constants';
|
||||
|
@ -279,7 +279,7 @@ export class MailboxSidebarComponent implements OnInit, OnDestroy
|
|||
const inboxFolder = this.folders.find(folder => folder.slug === 'inbox');
|
||||
|
||||
// Get the component -> navigation mock-api -> item
|
||||
const mainNavigationComponent = this._fuseNavigationService.getComponent('mainNavigation');
|
||||
const mainNavigationComponent = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>('mainNavigation');
|
||||
|
||||
// If the main navigation component exists...
|
||||
if ( mainNavigationComponent )
|
||||
|
|
|
@ -6,7 +6,7 @@ import { MatDrawer } from '@angular/material/sidenav';
|
|||
import { fromEvent, Subject } from 'rxjs';
|
||||
import { filter, takeUntil } from 'rxjs/operators';
|
||||
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { Tag, Task } from 'app/modules/admin/apps/tasks/tasks.types';
|
||||
import { TasksService } from 'app/modules/admin/apps/tasks/tasks.service';
|
||||
|
||||
|
@ -83,7 +83,7 @@ export class TasksListComponent implements OnInit, OnDestroy
|
|||
setTimeout(() => {
|
||||
|
||||
// Get the component -> navigation data -> item
|
||||
const mainNavigationComponent = this._fuseNavigationService.getComponent('mainNavigation');
|
||||
const mainNavigationComponent = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>('mainNavigation');
|
||||
|
||||
// If the main navigation component exists...
|
||||
if ( mainNavigationComponent )
|
||||
|
|
|
@ -687,7 +687,7 @@
|
|||
getNavItem(itemId, navigationName): FuseNavigationItem | null
|
||||
{
|
||||
// Get the component -> navigation data -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent(navigationName);
|
||||
const navComponent = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(navigationName);
|
||||
|
||||
// Return if the navigation component does not exist
|
||||
if ( !navComponent )
|
||||
|
@ -772,7 +772,7 @@
|
|||
updateBadgeTitle(itemId, navigationName, title): void
|
||||
{
|
||||
// Get the component -> navigation data -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent(navigationName);
|
||||
const navComponent = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(navigationName);
|
||||
|
||||
// Return if the navigation component does not exist
|
||||
if ( !navComponent )
|
||||
|
@ -850,7 +850,7 @@
|
|||
toggleDisabled(itemId, navigationName): void
|
||||
{
|
||||
// Get the component -> navigation data -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent(navigationName);
|
||||
const navComponent = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(navigationName);
|
||||
|
||||
// Return if the navigation component does not exist
|
||||
if ( !navComponent )
|
||||
|
@ -940,7 +940,7 @@
|
|||
swapNavigationData(navigationName): void
|
||||
{
|
||||
// Get the component -> navigation data -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent(navigationName);
|
||||
const navComponent = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(navigationName);
|
||||
|
||||
// Return if the navigation component does not exist
|
||||
if ( !navComponent )
|
||||
|
@ -949,7 +949,7 @@
|
|||
}
|
||||
|
||||
// A navigation data to replace with
|
||||
const newNavigation = [
|
||||
const newNavigation: FuseNavigationItem[] = [
|
||||
{
|
||||
id : 'supported-components',
|
||||
title : 'Supported components',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { FuseNavigationItem, FuseNavigationService } from '@fuse/components/navigation';
|
||||
import { FuseNavigationItem, FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
|
||||
import { CoreFeaturesComponent } from 'app/modules/admin/docs/core-features/core-features.component';
|
||||
|
||||
@Component({
|
||||
|
@ -32,8 +32,8 @@ export class NavigationComponent
|
|||
*/
|
||||
getNavItem(itemId, navigationName): FuseNavigationItem | null
|
||||
{
|
||||
// Get the component -> navigation mock-api -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent(navigationName);
|
||||
// Get the component -> navigation data -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(navigationName);
|
||||
|
||||
// Return if the navigation component does not exist
|
||||
if ( !navComponent )
|
||||
|
@ -57,8 +57,8 @@ export class NavigationComponent
|
|||
*/
|
||||
updateBadgeTitle(itemId, navigationName, title): void
|
||||
{
|
||||
// Get the component -> navigation mock-api -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent(navigationName);
|
||||
// Get the component -> navigation data -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(navigationName);
|
||||
|
||||
// Return if the navigation component does not exist
|
||||
if ( !navComponent )
|
||||
|
@ -81,8 +81,8 @@ export class NavigationComponent
|
|||
*/
|
||||
toggleDisabled(itemId, navigationName): void
|
||||
{
|
||||
// Get the component -> navigation mock-api -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent(navigationName);
|
||||
// Get the component -> navigation data -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(navigationName);
|
||||
|
||||
// Return if the navigation component does not exist
|
||||
if ( !navComponent )
|
||||
|
@ -98,14 +98,14 @@ export class NavigationComponent
|
|||
}
|
||||
|
||||
/**
|
||||
* Swap navigation mock-api
|
||||
* Swap navigation data
|
||||
*
|
||||
* @param navigationName
|
||||
*/
|
||||
swapNavigationData(navigationName): void
|
||||
{
|
||||
// Get the component -> navigation mock-api -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent(navigationName);
|
||||
// Get the component -> navigation data -> item
|
||||
const navComponent = this._fuseNavigationService.getComponent<FuseVerticalNavigationComponent>(navigationName);
|
||||
|
||||
// Return if the navigation component does not exist
|
||||
if ( !navComponent )
|
||||
|
@ -113,8 +113,8 @@ export class NavigationComponent
|
|||
return null;
|
||||
}
|
||||
|
||||
// A navigation mock-api to replace with
|
||||
const newNavigation = [
|
||||
// A navigation data to replace with
|
||||
const newNavigation: FuseNavigationItem[] = [
|
||||
{
|
||||
id : 'supported-components',
|
||||
title : 'Supported components',
|
||||
|
@ -168,7 +168,7 @@ export class NavigationComponent
|
|||
}
|
||||
];
|
||||
|
||||
// Replace the navigation mock-api
|
||||
// Replace the navigation data
|
||||
navComponent.navigation = newNavigation;
|
||||
navComponent.refresh();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user