2 Copyright 2020 TATA ELXSI
4 Licensed under the Apache License, Version 2.0 (the 'License');
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
16 Author: SANDHYA JS (sandhya.j@tataelxsi.co.in)
19 * @file WarningConfiguration Model
21 import { Component, Injector, Input } from '@angular/core';
22 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
25 * @Component takes WarningComponent.html as template url
28 selector: 'app-warning',
29 templateUrl: './WarningComponent.html',
30 styleUrls: ['./WarningComponent.scss']
32 /** Exporting a class @exports WarningComponent */
33 export class WarningComponent {
34 /** To inject services @public */
35 public injector: Injector;
37 /** Instance for active modal service @public */
38 public activeModal: NgbActiveModal;
40 /** Check the loading results @public */
41 public isLoad: Boolean = false;
43 /** Contains title data @public */
45 public heading: string;
47 /** Contains body data @public */
49 public confirmationMessage: string;
51 /** Contains footer data @public */
53 public submitMessage: string;
55 /** Give the message for the loading @public */
56 public message: string = 'PLEASEWAIT';
58 constructor(injector: Injector) {
59 this.injector = injector;
60 this.activeModal = this.injector.get(NgbActiveModal);
64 * Lifecyle Hooks the trigger before component is instantiate
66 public ngOnInit(): void {
70 /** Close the modal @public */
71 public closeModal(getMessage: string): void {
72 this.activeModal.close({ message: getMessage });