mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 01:03:35 +00:00
[CL-135] Migrate component library to standalone components (#12389)
* Migrate component library to standalone components * Fix tests
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// FIXME: Update this file to be type safe and remove this and next line
|
||||
// @ts-strict-ignore
|
||||
import { NgIf, NgClass } from "@angular/common";
|
||||
import { Component, Input, OnChanges } from "@angular/core";
|
||||
import { DomSanitizer, SafeResourceUrl } from "@angular/platform-browser";
|
||||
|
||||
@@ -18,6 +19,8 @@ const SizeClasses: Record<SizeTypes, string[]> = {
|
||||
@Component({
|
||||
selector: "bit-avatar",
|
||||
template: `<img *ngIf="src" [src]="src" title="{{ title || text }}" [ngClass]="classList" />`,
|
||||
standalone: true,
|
||||
imports: [NgIf, NgClass],
|
||||
})
|
||||
export class AvatarComponent implements OnChanges {
|
||||
@Input() border = false;
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { NgModule } from "@angular/core";
|
||||
|
||||
import { AvatarComponent } from "./avatar.component";
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule],
|
||||
imports: [AvatarComponent],
|
||||
exports: [AvatarComponent],
|
||||
declarations: [AvatarComponent],
|
||||
})
|
||||
export class AvatarModule {}
|
||||
|
||||
Reference in New Issue
Block a user