Update to Angular v17 syntax

This commit is contained in:
Geomitron
2023-12-25 10:43:21 -06:00
parent 199374b2e2
commit f931a1b221
8 changed files with 146 additions and 194 deletions

View File

@@ -1,39 +0,0 @@
import { Directive, ElementRef, EventEmitter, Output } from '@angular/core'
@Directive({
selector: '[appCheckbox]',
})
export class CheckboxDirective {
@Output() checked = new EventEmitter<boolean>()
_isChecked = false
constructor(private checkbox: ElementRef) { }
// ngAfterViewInit() {
// TODO
// $(this.checkbox.nativeElement).checkbox({
// onChecked: () => {
// this.checked.emit(true)
// this._isChecked = true
// },
// onUnchecked: () => {
// this.checked.emit(false)
// this._isChecked = false
// },
// })
// }
check(isChecked: boolean) {
this._isChecked = isChecked
if (isChecked) {
this.checkbox.nativeElement.checked = true
} else {
this.checkbox.nativeElement.checked = false
}
}
get isChecked() {
return this._isChecked
}
}