summaryrefslogtreecommitdiffstats
path: root/rulemgt-frontend/src/app/correlation-modal/modal.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'rulemgt-frontend/src/app/correlation-modal/modal.component.ts')
-rw-r--r--rulemgt-frontend/src/app/correlation-modal/modal.component.ts51
1 files changed, 29 insertions, 22 deletions
diff --git a/rulemgt-frontend/src/app/correlation-modal/modal.component.ts b/rulemgt-frontend/src/app/correlation-modal/modal.component.ts
index cafb8e5..1d458b0 100644
--- a/rulemgt-frontend/src/app/correlation-modal/modal.component.ts
+++ b/rulemgt-frontend/src/app/correlation-modal/modal.component.ts
@@ -13,31 +13,38 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-import { Component, Input, OnInit } from '@angular/core';
-import { ModalService } from './modal.service';
-import { Msg } from './msg';
-declare var $: any;
-@Component({
-
- selector: 'sif-modal',
- templateUrl: './modal.component.html',
+import {Component, OnInit} from '@angular/core';
+import {ModalService} from './modal.service';
+import {Msg} from './msg';
+@Component({
+ selector: 'sif-modal',
+ templateUrl: './modal.component.html',
+ styleUrls: ['./modal.component.css']
})
export class SifModalComponent implements OnInit {
- constructor(private modalServer: ModalService) { };
- modalTitle = 'modalTitleDefault';
- modalBodyMessage = 'modalBodyMessageDefault';
- closeBtnTitle = 'closeBtnTitleDefault';
-
- ngOnInit(): void {
- this.modalServer.getmodalObservable.subscribe((msg: Msg) => {
- console.log('receive ' + msg);
- this.modalTitle = msg.title || this.modalTitle;
- this.modalBodyMessage = msg.message || this.modalBodyMessage;
- this.closeBtnTitle = msg.btn || this.closeBtnTitle;
- $('#myModal').modal('show');
- });
- }
+ modalTitle = 'modalTitleDefault';
+ modalBodyMessage = 'modalBodyMessageDefault';
+ closeBtnTitle = 'closeBtnTitleDefault';
+
+ showModal = false;
+
+ constructor(private modalServer: ModalService) {
+ this.modalServer.openModalAnnounced$.subscribe((msg: Msg) => {
+ console.log('receive ', msg);
+ this.modalTitle = msg.title || this.modalTitle;
+ this.modalBodyMessage = msg.message || this.modalBodyMessage;
+ this.closeBtnTitle = msg.btn || this.closeBtnTitle;
+ this.showModal = true;
+ });
+ };
+
+ ngOnInit(): void {
+ }
+
+ cancelModal(): void {
+ this.showModal = false;
+ }
}