mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Refactor unneeded ngIf
This commit is contained in:
parent
ec4ec41552
commit
8eabf8c77a
@ -1,13 +1,13 @@
|
|||||||
<div class="form-group paperless-input-select">
|
<div class="form-group paperless-input-select">
|
||||||
<label [for]="inputId">{{title}}</label>
|
<label [for]="inputId">{{title}}</label>
|
||||||
<div [class.input-group]="allowCreateNew">
|
<div [class.input-group]="allowCreateNew">
|
||||||
<ng-select *ngIf="allowCreateNew; else noAddTag" name="inputId" [(ngModel)]="value"
|
<ng-select name="inputId" [(ngModel)]="value"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
[style.color]="textColor"
|
[style.color]="textColor"
|
||||||
[style.background]="backgroundColor"
|
[style.background]="backgroundColor"
|
||||||
[clearable]="allowNull"
|
[clearable]="allowNull"
|
||||||
[items]="items"
|
[items]="items"
|
||||||
[addTag]="addItemRef"
|
[addTag]="allowCreateNew && addItemRef"
|
||||||
bindLabel="name"
|
bindLabel="name"
|
||||||
bindValue="id"
|
bindValue="id"
|
||||||
(change)="onChange(value)"
|
(change)="onChange(value)"
|
||||||
@ -16,22 +16,6 @@
|
|||||||
(clear)="clearLastSearchTerm()"
|
(clear)="clearLastSearchTerm()"
|
||||||
(blur)="onBlur()">
|
(blur)="onBlur()">
|
||||||
</ng-select>
|
</ng-select>
|
||||||
<ng-template #noAddTag>
|
|
||||||
<ng-select name="inputId" [(ngModel)]="value"
|
|
||||||
[disabled]="disabled"
|
|
||||||
[style.color]="textColor"
|
|
||||||
[style.background]="backgroundColor"
|
|
||||||
[clearable]="allowNull"
|
|
||||||
[items]="items"
|
|
||||||
bindLabel="name"
|
|
||||||
bindValue="id"
|
|
||||||
(change)="onChange(value)"
|
|
||||||
(search)="onSearch($event)"
|
|
||||||
(focus)="clearLastSearchTerm()"
|
|
||||||
(clear)="clearLastSearchTerm()"
|
|
||||||
(blur)="onBlur()">
|
|
||||||
</ng-select>
|
|
||||||
</ng-template>
|
|
||||||
<div *ngIf="allowCreateNew" class="input-group-append">
|
<div *ngIf="allowCreateNew" class="input-group-append">
|
||||||
<button class="btn btn-outline-secondary" type="button" (click)="addItem()">
|
<button class="btn btn-outline-secondary" type="button" (click)="addItem()">
|
||||||
<svg class="buttonicon" fill="currentColor">
|
<svg class="buttonicon" fill="currentColor">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user