Skip to content

Commit bd3c4de

Browse files
authoredJan 14, 2019
Merge pull request #394 from topcoderinc/issue-239
fixes issue 239
2 parents 7678640 + 94d0c41 commit bd3c4de

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed
 

‎src/app/components/add-value-form/add-value-form.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
cdkAutosizeMaxRows="7"></textarea>
4040
</mat-form-field>
4141

42-
<button mat-icon-button (click)="onRemoveItem(getItemArray(),i)">
42+
<button mat-icon-button (click)="onRemoveItem(getItemArray(),i)" *ngIf="!isEditMode">
4343
<i class="material-icons delete-icon">delete</i>
4444
</button>
4545
</div>

‎src/app/components/add-value-form/add-value-form.component.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,7 @@ export class AddValueFormComponent implements OnInit {
6969
* @param index the index
7070
*/
7171
onRemoveItem(arr, index) {
72-
if (this.isEditMode) {
73-
this.onValueDelete.emit({
74-
element: arr[index],
75-
callback: () => {
76-
arr.splice(index, 1);
77-
}
78-
});
79-
} else {
72+
if (!this.isEditMode) {
8073
arr.splice(index, 1);
8174
}
8275
}

0 commit comments

Comments
 (0)
Please sign in to comment.