diff options
Diffstat (limited to 'client/src/app/shared/shared-forms/select-tags.component.ts')
-rw-r--r-- | client/src/app/shared/shared-forms/select-tags.component.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/client/src/app/shared/shared-forms/select-tags.component.ts b/client/src/app/shared/shared-forms/select-tags.component.ts index 2e07d7e8f..a8a19d788 100644 --- a/client/src/app/shared/shared-forms/select-tags.component.ts +++ b/client/src/app/shared/shared-forms/select-tags.component.ts | |||
@@ -14,14 +14,14 @@ import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms' | |||
14 | ] | 14 | ] |
15 | }) | 15 | }) |
16 | export class SelectTagsComponent implements ControlValueAccessor { | 16 | export class SelectTagsComponent implements ControlValueAccessor { |
17 | @Input() items: string[] = [] | 17 | @Input() availableItems: string[] = [] |
18 | @Input() _items: string[] = [] | 18 | @Input() selectedItems: string[] = [] |
19 | 19 | ||
20 | propagateChange = (_: any) => { /* empty */ } | 20 | propagateChange = (_: any) => { /* empty */ } |
21 | 21 | ||
22 | writeValue (items: string[]) { | 22 | writeValue (items: string[]) { |
23 | this._items = items | 23 | this.selectedItems = items |
24 | this.propagateChange(this._items) | 24 | this.propagateChange(this.selectedItems) |
25 | } | 25 | } |
26 | 26 | ||
27 | registerOnChange (fn: (_: any) => void) { | 27 | registerOnChange (fn: (_: any) => void) { |
@@ -33,6 +33,8 @@ export class SelectTagsComponent implements ControlValueAccessor { | |||
33 | } | 33 | } |
34 | 34 | ||
35 | onModelChange () { | 35 | onModelChange () { |
36 | this.propagateChange(this._items) | 36 | console.log(this.selectedItems) |
37 | |||
38 | this.propagateChange(this.selectedItems) | ||
37 | } | 39 | } |
38 | } | 40 | } |