NGXF
  • 🚀Introduction
  • Get Started
    • Why
    • Installation
  • Concepts
    • Introduction
  • Features
    • Activated Route
    • Call
    • Init
    • Lazy
    • Keep Alive
    • Timeout
    • Track By Key
    • Repeat
    • Virtual Scroll
  • Server Interaction
    • Async
    • Cookies
    • Http
    • Socket.IO
  • Hooks
    • State Hook
    • Effect Hook
    • Reducer Hook
  • Recompose
    • Compose
  • API
    • NgxfModule
    • HttpDirective
    • RouteDirective
    • InitDirective
    • ComposeDirective
    • ReturnDirective
    • TimeoutDirective
    • CookiesDirective
    • AsyncDirective
    • LazyDirective
    • CallPipe
  • Recipes
    • Caching
    • Style Guide
  • Community
    • FAQ
    • Contributing
Powered by GitBook
On this page
  • Getting ActivatedRoute
  • Getting field value of ActivatedRoute
  1. Features

Activated Route

The directive is provides access to ActivatedRoute. The directive allows you to not use async pipe and removes boilerplate code from the component.

Getting ActivatedRoute

An example to get ActivatedRoute in COMPONENT.template.html.

<ng-container *route="let route">
    {{ route }} // is ActivatedRoute instance
</ng-container>

Getting field value of ActivatedRoute

All fields with observables will return the current value and will receive new values automatically.

An example to get field value of ActivatedRoute in COMPONENT.template.html.

<ng-container *route="let value = FIELD">
    {{ value }} // is ActivatedRoute[FIELD]
</ng-container>
<ng-container *route="let params = paramMap">
    {{ params.get('id') }}
</ng-container>
<ng-container *route="let params = params">
    {{ params.id }}
</ng-container>
PreviousIntroductionNextCall

Last updated 6 years ago