Linked checkboxes to "download selected" button

This commit is contained in:
Geomitron
2020-02-10 00:43:39 -05:00
parent 1e16371958
commit a98b03dcd4
12 changed files with 105 additions and 36 deletions

View File

@@ -0,0 +1,19 @@
import { Directive, ElementRef, Output, EventEmitter } from '@angular/core'
@Directive({
selector: '[appCheckbox]'
})
export class CheckboxDirective {
@Output() checked = new EventEmitter<boolean>()
private _checked = false
constructor(element: ElementRef) {
$(element.nativeElement).checkbox({
onChange: () => {
this._checked = !this._checked
this.checked.emit(this._checked)
}
})
}
}