File
Implements
Index
Properties
|
|
Methods
|
|
Inputs
|
|
Outputs
|
|
HostListeners
|
|
Outputs
close
|
Type : EventEmitter
|
|
HostListeners
window:popstate
|
Arguments : '$event'
|
window:popstate(event)
|
|
Methods
navigateToAddCertificate
|
navigateToAddCertificate()
|
|
|
onPopState
|
onPopState(event)
|
Decorators :
@HostListener('window:popstate', ['$event'])
|
|
|
confirmationModal
|
Decorators :
@ViewChild('confirmationModal', {static: true})
|
|
import { Component, OnInit, ViewChild, Output, EventEmitter, Input, HostListener } from '@angular/core';
import { ResourceService } from '@sunbird/shared';
@Component({
selector: 'app-confirmation-popup',
templateUrl: './confirmation-popup.component.html',
styleUrls: ['./confirmation-popup.component.scss']
})
export class ConfirmationPopupComponent implements OnInit {
@ViewChild('confirmationModal', {static: true}) confirmationModal;
@Input() popupMode: string;
@Input() batchId: string;
@Output() close = new EventEmitter<any>();
@HostListener('window:popstate', ['$event'])
onPopState(event) {
this.closeModal();
}
constructor(public resourceService: ResourceService) { }
ngOnInit() {
}
closeModal() {
this.confirmationModal && this.confirmationModal.deny();
this.close.emit();
}
navigateToAddCertificate() {
this.confirmationModal && this.confirmationModal.deny();
this.close.emit({mode: 'add-certificates', batchId: this.batchId});
}
}
<app-modal-wrapper [config]="{disableClose: true, size: 'normal', panelClass: 'material-modal'}" (dismiss)="closeModal()" #confirmationModal>
<ng-template sbModalContent>
<div class="sb-mat__modal sb-batch-update-modal">
<!-- Header-->
<div mat-dialog-title class="mb-0">
<div class="title"></div>
<button aria-label="close dialog" mat-dialog-close class="close-btn"></button>
</div>
<!-- Content-->
<div class="sb-mat__modal__content">
<div class="ui stackable grid my-8">
<div class="one wide column">
<div class="checkbox-img"></div>
</div>
<div class="eleven wide column">
<div *ngIf="popupMode === 'create'" class="pb-16 font-weight-bold">
{{resourceService?.frmelmnts?.cert?.lbl?.batchCreateSuccess}}</div>
<div *ngIf="popupMode === 'edit'" class="pb-16 font-weight-bold">
{{resourceService?.frmelmnts?.cert?.lbl?.batchUpdateSuccess}}</div>
<div class="">{{resourceService?.frmelmnts?.cert?.lbl?.addCertToBatch}}</div>
</div>
</div>
</div>
<!-- Action-->
<div class="sb-mat__modal__actions">
<button id="close-modal-btn" class="sb-btn sb-btn-normal sb-btn-primary" tabindex="0"
(click)="closeModal()">
{{resourceService?.frmelmnts.btn.close}}
</button>
<button id="add-certificate" class="sb-btn sb-btn-normal sb-btn-outline-primary ml-8" tabindex="0"
(click)="navigateToAddCertificate()">
{{resourceService?.frmelmnts.cert.lbl.addCert}}
</button>
</div>
</div>
</ng-template>
</app-modal-wrapper>
Legend
Html element with directive