Created
January 5, 2021 05:12
-
-
Save thisiszoaib/5e26f11151ab67a0ed5ba73aec0910ab to your computer and use it in GitHub Desktop.
Chips 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ngAfterViewInit() { | |
this.chipList.chipSelectionChanges | |
.pipe( | |
untilDestroyed(this), | |
map((event) => event.source)) | |
.subscribe((chip) => { | |
if (chip.selected) { | |
this.value = [...this.value, chip.value]; | |
} else { | |
this.value = this.value.filter((o) => o !== chip.value); | |
} | |
this.propagateChange(this.value); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment