routeshub
  • Introduction
  • Installation
  • Example
    • Initial Code
    • Creating Notes
    • Creating Hub
    • Navigating
  • Concepts
    • Introduction
    • Notes
    • Units
  • API
    • Interfaces
    • Creators
    • Directives
    • Functions
    • Decorators
Powered by GitBook
On this page

Was this helpful?

  1. API

Decorators

Secluded

A decorator that applies unit to the component's property by unit identifier or unit name.

Generic Type:

T = any

Args:

(
  arg: privateNotesKey
)

Return Type:

(target: any, propertyKey: PropertyKey) => void

Usage example:

....

@Component({
...
})
export class HeaderComponent {

  // getting unit by key
  @Secluded(APP_HUB_KEY)
  private app: Unit<AppNotes, AppChildNotes>;

  // getting unit by unit name
  @Secluded('about')
  private about: Unit<AboutNotes>;
}
PreviousFunctions

Last updated 5 years ago

Was this helpful?