coreui-angular-ex
Version:
CoreUI Components Library for Angular
50 lines (44 loc) • 1.47 kB
text/typescript
import { Component, HostBinding, Input } from '@angular/core';
import { CommonModule, NgIf, NgTemplateOutlet } from '@angular/common';
import { RouterModule } from '@angular/router';
import { HtmlAttributesDirective, SharedModule } from '../../shared';
import { INavAttributes, INavLinkProps } from './breadcrumb-item';
({
selector: 'c-breadcrumb-item',
templateUrl: './breadcrumb-item.component.html',
styleUrls: ['./breadcrumb-item.component.scss'],
standalone: true,
imports: [RouterModule, NgIf, NgTemplateOutlet, HtmlAttributesDirective]
})
export class BreadcrumbItemComponent {
/**
* Toggle the active state for the component. [docs]
* @type boolean
*/
() active?: boolean;
/**
* The `url` prop for the inner `[routerLink]` directive. [docs]
* @type string
*/
() url?: string | any[];
/**
* Additional html attributes for link. [docs]
* @type INavAttributes
*/
() attributes?: INavAttributes;
/**
* Some `NavigationExtras` props for the inner `[routerLink]` directive and `routerLinkActiveOptions`. [docs]
* @type INavLinkProps
*/
() linkProps?: INavLinkProps;
('attr.aria-current') get ariaCurrent(): string | null {
return this.active ? 'page' : null;
}
('class')
get hostClasses(): any {
return {
'breadcrumb-item': true,
active: this.active
};
}
}