flowbite-angular
Version:
<div align="center"> <h1>:construction: flowbite-angular (unreleased) :construction:</h1> <p> <a href="https://flowbite.com"> <img alt="Flowbite - Tailwind CSS components" width="350" src="https://flowbite.s3.amazonaws.com/github/logo-github
74 lines (70 loc) • 3.13 kB
JavaScript
import * as i0 from '@angular/core';
import { inject, model, Directive } from '@angular/core';
import * as i1 from '@angular/router';
import { Router, RouterLink } from '@angular/router';
/**
* Wrapping directive over RouterLink.
*
* @see `RouterLink`
*/
class FlowbiteRouterLinkDirective {
constructor() {
/**
* `Router` service
*/
this.router = inject(Router);
/**
* `RouterLink` directive
*/
this.routerLink = inject(RouterLink);
/**
* @todo Verify utility
*/
this.href = model();
}
/**
* @todo Verify utility
*/
onClick() {
const hrefValue = this.href();
if (hrefValue) {
this.router.navigateByUrl(hrefValue);
}
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FlowbiteRouterLinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.4", type: FlowbiteRouterLinkDirective, isStandalone: true, selector: "[flowbiteRouterLink]", inputs: { href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { href: "hrefChange" }, host: { listeners: { "click": "onClick()" } }, hostDirectives: [{ directive: i1.RouterLink, inputs: ["target", "target", "queryParams", "queryParams", "fragment", "fragment", "queryParamsHandling", "queryParamsHandling", "state", "state", "info", "info", "relativeTo", "relativeTo", "preserveFragment", "preserveFragment", "skipLocationChange", "skipLocationChange", "replaceUrl", "replaceUrl", "routerLink", "routerLink"] }], ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FlowbiteRouterLinkDirective, decorators: [{
type: Directive,
args: [{
standalone: true,
selector: '[flowbiteRouterLink]',
host: {
'(click)': 'onClick()',
},
hostDirectives: [
{
directive: RouterLink,
inputs: [
'target',
'queryParams',
'fragment',
'queryParamsHandling',
'state',
'info',
'relativeTo',
'preserveFragment',
'skipLocationChange',
'replaceUrl',
'routerLink',
],
outputs: [],
},
],
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { FlowbiteRouterLinkDirective };
//# sourceMappingURL=flowbite-angular-router-link.mjs.map