src/app/manage-learn/questionnaire/remarks-modal/remarks-modal.component.ts
selector | app-remarks-modal |
styleUrls | ./remarks-modal.component.scss |
templateUrl | ./remarks-modal.component.html |
Properties |
Methods |
Inputs |
constructor(modal: ModalController)
|
||||||
Parameters :
|
button | |
Type : string
|
|
data | |
Type : any
|
|
required | |
Type : boolean
|
|
close |
close()
|
Returns :
void
|
ngAfterViewChecked |
ngAfterViewChecked()
|
Returns :
void
|
update |
update()
|
Returns :
void
|
hideBack |
remarkInput |
Decorators :
@ViewChild('remarkInput', {static: false})
|
import { Component, Input, ViewChild } from '@angular/core';
import { ModalController } from '@ionic/angular';
@Component({
selector: 'app-remarks-modal',
templateUrl: './remarks-modal.component.html',
styleUrls: ['./remarks-modal.component.scss'],
})
export class RemarksModalComponent {
@ViewChild('remarkInput', {static: false}) remarkInput;
hideBack;
@Input() data: any;
@Input() button: string;
@Input() required: boolean;
constructor(private modal: ModalController) {}
close(): void {
this.modal.dismiss();
}
update(): void {
this.modal.dismiss(this.data.remarks);
}
ngAfterViewChecked() {
this.remarkInput.setFocus();
}
}
<ion-content class="ion-padding">
<ion-item>
<ion-textarea [(ngModel)]="data.remarks" placeholder="Remarks" #remarkInput style="height: 40vh"></ion-textarea>
</ion-item>
</ion-content>
<div class="_footer" no-padding>
<ion-row>
<ion-col>
<ion-button icon-start expand="full" color="light" (click)="close()" class="custom-btn-txt-transform-none">
{{'CANCEL'|translate}}
</ion-button>
</ion-col>
<ion-col>
<ion-button icon-start expand="full" (click)="update()" color="primary" class="custom-btn-txt-transform-none"
[disabled]="required ? !data.remarks : false">
{{'FRMELEMENTS_BTN_ADD'|translate}}
</ion-button>
</ion-col>
</ion-row>
</div>
./remarks-modal.component.scss