mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Linked checkboxes to "download selected" button
This commit is contained in:
19
src/app/core/directives/checkbox.directive.ts
Normal file
19
src/app/core/directives/checkbox.directive.ts
Normal 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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user