File

app-layout/src/app-sidenav/sidenav.service.ts

Description

Provides control and state of the app's side navigation.

Import

Example :
import { SidenavService } from '@talenra/components/app-layout';

Index

Properties
Methods

Methods

Public getIndicesByIdentifier
getIndicesByIdentifier(identifier: string)

Developer Preview: Returns an array of indices of items matching a given identifer. Returns an empty array if no matches.

Parameters :
Name Type Optional Default value
identifier string No ''
Returns : [][]
Public getItemsByIdentifier
getItemsByIdentifier(identifier: string)

Developer Preview: Returns an array of items matching a given identifer. Returns an empty array if no matches.

Parameters :
Name Type Optional Default value
identifier string No ''
Returns : SidenavItem[]
Public setExpanded
setExpanded(isExpanded: boolean)

Collapses or expands the side-navigation

Parameters :
Name Type Optional
isExpanded boolean No
Returns : void
Public setHidden
setHidden(isHidden: boolean)

Hides or shows the side-navigation

Parameters :
Name Type Optional
isHidden boolean No
Returns : void

Properties

Public Readonly currentItems$
Type : unknown
Default value : new BehaviorSubject<SidenavItem[] | null>(null)

Developer Preview: Provides an array with the currently selected sidenav items.

Example :
constructor(private navigationService: SidenavService) {}

ngOnInit(): void {
  this.navigationService.currentItems$.subscribe((value) => {
    console.log(value);
  });
}

This feature is considered experimental as the logic could be implemented by the consuming app, which might be the ideal approach (only implemented if used).

Public Readonly isExpanded$
Type : unknown
Default value : new BehaviorSubject(false)

Provides whether the side-navigation is expanded. Note that it might be expanded even when hidden.

Public Readonly isHidden$
Type : unknown
Default value : new BehaviorSubject(false)

Provides whether the side-navigation is hidden. Note that the side-navigation will keep its state (collapsed or expanded) while hidden.

results matching ""

    No results matching ""