Revision 51427
Added by Myrto Koukouli about 6 years ago
my-array.interface.ts | ||
---|---|---|
25 | 25 |
</div> |
26 | 26 |
</div> |
27 | 27 |
</div> |
28 |
|
|
29 |
|
|
30 |
<confirmation-dialog #confirmDelete [title]="'Delete Interface'" [isModalShown]="isModalShown" |
|
31 |
[confirmActionButton]="'Yes, delete it'" (emitObject)="confirmedRemove($event)"> |
|
32 |
Are you sure you want to delete this interface? |
|
33 |
</confirmation-dialog> |
|
34 |
|
|
28 | 35 |
` |
29 | 36 |
|
30 | 37 |
}) |
... | ... | |
79 | 86 |
console.log(this.viewContainerRef.get(0)); |
80 | 87 |
((this.parentGroup as FormArray).controls[this.name].at(0).corpus((<MyGroup>componentView.instance).generate().value)); |
81 | 88 |
} else { |
82 |
(<MyGroup>componentView.instance).toBeDeleted = true; |
|
89 |
this.curIntrf = <MyGroup>componentView.instance; |
|
90 |
this.curIndex = index; |
|
91 |
this.confirmRemoveInterface(); |
|
92 |
/*(<MyGroup>componentView.instance).toBeDeleted = true; |
|
83 | 93 |
this.remove(index); |
84 | 94 |
(this.parentGroup as FormArray).controls[this.name].removeAt(index-1); |
85 |
this.arrayData_.splice(index-1,1); |
|
95 |
this.arrayData_.splice(index-1,1);*/
|
|
86 | 96 |
} |
87 | 97 |
}); |
88 | 98 |
|
... | ... | |
92 | 102 |
console.log("ADDED NEW GROUP IN CREATEVIEW"); |
93 | 103 |
} |
94 | 104 |
|
105 |
isModalShown: boolean = false; |
|
106 |
curIntrf: any; |
|
107 |
curIndex: number; |
|
108 |
|
|
109 |
@ViewChild('confirmDelete') |
|
110 |
public confirmDelete: ConfirmationDialogComponent; |
|
111 |
|
|
112 |
confirmRemoveInterface(){ |
|
113 |
this.confirmDelete.showModal(); |
|
114 |
} |
|
115 |
|
|
116 |
confirmedRemove(){ |
|
117 |
this.curIntrf.toBeDeleted = true; |
|
118 |
this.remove(this.curIndex); |
|
119 |
(this.parentGroup as FormArray).controls[this.name].removeAt(this.curIndex-1); |
|
120 |
this.arrayData_.splice(this.curIndex-1,1); |
|
121 |
} |
|
122 |
|
|
95 | 123 |
remove(i : number) : void { |
96 | 124 |
this.viewContainerRef.remove(i); |
97 | 125 |
} |
... | ... | |
160 | 188 |
template : ` |
161 | 189 |
<div class="el-item uk-card uk-card-default uk-card-body uk-scrollspy-inview uk-animation-fade"> |
162 | 190 |
<div class="interfaceActionsPanel" style="margin-left: 5px;"> |
163 |
<a (click)="confirmRemoveInterface()"><i class="fa fa-remove fa-lg"></i></a>
|
|
191 |
<a (click)="remove()"><i class="fa fa-remove fa-lg"></i></a>
|
|
164 | 192 |
</div> |
165 | 193 |
<ng-template my-form></ng-template> |
166 | 194 |
</div> |
167 | 195 |
|
168 |
|
|
169 |
<confirmation-dialog #confirmDelete [title]="'Delete Interface'" [isModalShown]="isModalShown" |
|
170 |
[confirmActionButton]="'Yes, delete it'" (emitObject)="confirmedRemove($event)"> |
|
171 |
Are you sure you want to delete this interface? |
|
172 |
</confirmation-dialog> |
|
173 | 196 |
` |
174 | 197 |
|
175 | 198 |
}) |
176 | 199 |
export class MyArrayWrapper extends MyWrapper{ |
177 | 200 |
|
178 |
isModalShown: boolean = false; |
|
179 |
|
|
180 |
@ViewChild('confirmDelete') |
|
181 |
public confirmDelete: ConfirmationDialogComponent; |
|
182 |
|
|
183 |
confirmRemoveInterface(){ |
|
184 |
this.confirmDelete.showModal(); |
|
185 |
} |
|
186 |
|
|
187 |
confirmedRemove(){ |
|
188 |
this.remove(); |
|
189 |
} |
|
190 | 201 |
} |
191 | 202 |
|
192 | 203 |
@Component({ |
Also available in: Unified diff
fixed modal problem!