File
Constructor
constructor(modal: ModalController)
|
|
Parameters :
Name |
Type |
Optional |
modal |
ModalController
|
No
|
|
Methods
Async
openUpdateRemarks
|
openUpdateRemarks()
|
|
|
import { Component, Input } from '@angular/core';
import { RemarksModalComponent } from '@app/app/manage-learn/questionnaire/remarks-modal/remarks-modal.component';
import { ModalController } from '@ionic/angular';
@Component({
selector: 'app-remarks',
templateUrl: './remarks.component.html',
styleUrls: ['./remarks.component.scss'],
})
export class RemarksComponent {
@Input() data: any;
constructor(private modal: ModalController) { }
async openUpdateRemarks() {
const remarks = await this.modal.create({
component: RemarksModalComponent,
componentProps: { data: JSON.parse(JSON.stringify(this.data)) }
});
await remarks.present();
const { data } = await remarks.onDidDismiss();
if (data) {
this.data.remarks = data;
}
}
}
<!-- Generated template for the RemarksComponent component -->
<div class="ion-margin-top ion-margin-bottom">
<h4 class="_flex-box justify-content">
<div style="flex:1">{{'FRMELEMENTS_LBL_REMARKS'|translate}}</div>
<button class="btn-block px-10 sb-bg-color-primary" *ngIf="!data.remarks" (click)="openUpdateRemarks()">
{{'FRMELEMENTS_BTN_ADD'|translate}}
</button>
<button class="btn-block px-10 sb-bg-color-primary" *ngIf="data.remarks" (click)="data.remarks = ''">
{{'FRMELEMNTS_BTN_DELETE'|translate}}
</button>
</h4>
<ion-item *ngIf="data.remarks" (click)="openUpdateRemarks()">
<ion-label>{{data.remarks}}</ion-label>
<ion-icon name="create" slot="end"></ion-icon>
</ion-item>
</div>
button {
height: 1.5rem;
}
Legend
Html element with directive