1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

video add to playlist component -> onpush strategy

This commit is contained in:
Chocobozzz 2019-04-05 14:16:48 +02:00
parent 3a0fb65c61
commit 8dfceec44a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
11 changed files with 46 additions and 13 deletions

View file

@ -1,4 +1,4 @@
import { Component, forwardRef, Input } from '@angular/core'
import { ChangeDetectorRef, Component, forwardRef, Input, OnChanges, SimpleChanges } from '@angular/core'
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
@Component({
@ -21,10 +21,19 @@ export class PeertubeCheckboxComponent implements ControlValueAccessor {
@Input() helpHtml: string
@Input() disabled = false
// FIXME: https://github.com/angular/angular/issues/10816#issuecomment-307567836
@Input() onPushWorkaround = false
constructor (private cdr: ChangeDetectorRef) { }
propagateChange = (_: any) => { /* empty */ }
writeValue (checked: boolean) {
this.checked = checked
if (this.onPushWorkaround) {
this.cdr.markForCheck()
}
}
registerOnChange (fn: (_: any) => void) {