UNPKG

@this-dot/route-config

Version:

A library containing directives and services for configuring components via Route's routeData property

33 lines (32 loc) 1.72 kB
import { OnInit, TemplateRef, ViewContainerRef } from '@angular/core'; import { RouteDataHasService } from '../route-data-has/route-data-has.service'; import * as i0 from "@angular/core"; /** * Retrieves the provided route config property and binds it into a template variable * * @example * <!-- Display an element only if the "show" routeTag is truthy --> * <p *tdRouteTag="'show'"> * This text is only visible, if there is a 'show' tag in the route data's `routeTags` Array * </p> * * @example * <!-- Display an element only if the "show" routeTag is truthy and display a fallback template if it is falsy --> * <p *tdRouteTag="'show'; else noShowTag"> * This text is only visible, if there is a 'show' tag in the route data's `routeTags` Array * </p> * <ng-template #noShowTag> * <p>There is no 'show' tag in this route's config</p> * </ng-template> */ export declare class RouteTagDirective<CThen, CElse, RouteTags extends string = string> implements OnInit { private template; private viewContainer; private routeDataHasService; set tdRouteTag(tags: RouteTags | RouteTags[]); set tdRouteTagElse(elseTemplate: TemplateRef<CElse>); constructor(template: TemplateRef<CThen>, viewContainer: ViewContainerRef, routeDataHasService: RouteDataHasService<CThen, CElse, RouteTags, 'routeTags'>); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration<RouteTagDirective<any, any, any>, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<RouteTagDirective<any, any, any>, "[tdRouteTag]", never, { "tdRouteTag": { "alias": "tdRouteTag"; "required": false; }; "tdRouteTagElse": { "alias": "tdRouteTagElse"; "required": false; }; }, {}, never, never, false, never>; }