Skip to content

Commit

Permalink
Add exclude helper
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Jul 31, 2024
1 parent 4a29541 commit 7a204ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,19 @@
<div class="header">
Suggestions...
<div>
Created by:
Created by (prepend "-" to negate):
<button class="suggestion-button" (click)="addToSearch('@' + _sample_user)">
@{{_sample_user}}
</button>
</div>
<div *ngIf="tags[0]">
Tag:
Tag (prepend "-" to negate):
<span *ngFor="let tag of tags.slice(0,3)">
<button class="suggestion-button" (click)="addToSearch('#' + tag)">
#{{tag}}
</button>
</span>


</div>
<div>
</div>
</div>
<mat-divider></mat-divider>
<div class="header">
Examples:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export class SearchWindowComponent implements OnInit {
addToSearch(val: string) {
let _stringParts = val.split(" ");
_stringParts.forEach((subVal) => {
if (!this.searchString.includes(subVal)) {
this.searchString = subVal + " " + this.searchString;
if (!this.searchString?.includes(subVal)) {
this.searchString = `${subVal} ${this.searchString ?? ''}`;
}
}
);
Expand Down

0 comments on commit 7a204ad

Please sign in to comment.