@ng-doc/app
Version:
<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>
46 lines (42 loc) • 2.47 kB
JavaScript
import * as i0 from '@angular/core';
import { inject, Component, ChangeDetectionStrategy, Input, HostBinding } from '@angular/core';
import { NgDocCopyButtonComponent } from '@ng-doc/app/components/copy-button';
import { NgDocIconComponent, NgDocButtonIconComponent } from '@ng-doc/ui-kit';
import { LOCATION } from '@ng-web-apis/common';
class NgDocHeadingAnchorComponent {
constructor() {
this.classes = [];
this.location = inject(LOCATION);
}
get href() {
const { origin, pathname } = this.location;
return `${origin}${pathname}#${this.anchor}`;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocHeadingAnchorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: NgDocHeadingAnchorComponent, isStandalone: true, selector: "ng-doc-heading-anchor", inputs: { anchor: "anchor", classes: "classes" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
<ng-doc-copy-button [text]="href">
<ng-doc-icon icon="link-2"></ng-doc-icon>
</ng-doc-copy-button>
`, isInline: true, styles: [""], dependencies: [{ kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }, { kind: "component", type: NgDocCopyButtonComponent, selector: "ng-doc-copy-button", inputs: ["text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocHeadingAnchorComponent, decorators: [{
type: Component,
args: [{ selector: 'ng-doc-heading-anchor', imports: [NgDocButtonIconComponent, NgDocIconComponent, NgDocCopyButtonComponent], template: `
<ng-doc-copy-button [text]="href">
<ng-doc-icon icon="link-2"></ng-doc-icon>
</ng-doc-copy-button>
`, changeDetection: ChangeDetectionStrategy.OnPush }]
}], propDecorators: { anchor: [{
type: Input,
args: [{ required: true }]
}], classes: [{
type: Input
}, {
type: HostBinding,
args: ['class']
}] } });
/**
* Generated bundle index. Do not edit.
*/
export { NgDocHeadingAnchorComponent };
//# sourceMappingURL=ng-doc-app-components-heading-anchor.mjs.map