mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 10:13:31 +00:00
[CL-707] Migrate CL codebase to signals (#15340)
This commit is contained in:
@@ -7,9 +7,9 @@ import {
|
||||
Component,
|
||||
ElementRef,
|
||||
HostBinding,
|
||||
Input,
|
||||
signal,
|
||||
ViewChild,
|
||||
input,
|
||||
} from "@angular/core";
|
||||
|
||||
import { ToggleGroupComponent } from "./toggle-group.component";
|
||||
@@ -24,7 +24,7 @@ let nextId = 0;
|
||||
export class ToggleComponent<TValue> implements AfterContentChecked, AfterViewInit {
|
||||
id = nextId++;
|
||||
|
||||
@Input() value?: TValue;
|
||||
readonly value = input<TValue>();
|
||||
@ViewChild("labelContent") labelContent: ElementRef<HTMLSpanElement>;
|
||||
@ViewChild("bitBadgeContainer") bitBadgeContainer: ElementRef<HTMLSpanElement>;
|
||||
|
||||
@@ -41,7 +41,7 @@ export class ToggleComponent<TValue> implements AfterContentChecked, AfterViewIn
|
||||
}
|
||||
|
||||
get selected() {
|
||||
return this.groupComponent.selected === this.value;
|
||||
return this.groupComponent.selected() === this.value();
|
||||
}
|
||||
|
||||
get inputClasses() {
|
||||
@@ -95,7 +95,7 @@ export class ToggleComponent<TValue> implements AfterContentChecked, AfterViewIn
|
||||
}
|
||||
|
||||
onInputInteraction() {
|
||||
this.groupComponent.onInputInteraction(this.value);
|
||||
this.groupComponent.onInputInteraction(this.value());
|
||||
}
|
||||
|
||||
ngAfterContentChecked() {
|
||||
|
||||
Reference in New Issue
Block a user