1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-18 10:23:52 +00:00
Files
browser/libs/components/src/drawer/drawer-close.directive.ts
Oscar Hinton 26fb7effd3 Remove standalone true from platform and UIF (#15032)
Remove standalone: true from every instance since it's the default as of Angular 19.
2025-06-02 20:03:04 +02:00

29 lines
543 B
TypeScript

import { Directive, inject } from "@angular/core";
import { DrawerComponent } from "./drawer.component";
/**
* Closes the ancestor drawer
*
* @example
*
* ```html
* <bit-drawer>
* <button type="button" bitButton bitDrawerClose>Close</button>
* </bit-drawer>
* ```
**/
@Directive({
selector: "button[bitDrawerClose]",
host: {
"(click)": "onClick()",
},
})
export class DrawerCloseDirective {
private drawer = inject(DrawerComponent, { optional: true });
protected onClick() {
this.drawer?.open.set(false);
}
}