diff options
author | 2018-08-24 09:28:10 +0800 | |
---|---|---|
committer | 2018-08-24 09:28:10 +0800 | |
commit | 6e26bf0b71a8b8493fbd1575717a2c5e539f93ee (patch) | |
tree | 122b28e8c4ebf9ab70051ba34cec8e6ca022d27c /rulemgt-frontend/src/app/correlation-modal/modal.component.ts | |
parent | 448a62b47b193dd8a658b6d7c0ddf52dbfe2589b (diff) |
Fixed ui error
Change-Id: I2a26998cc093a7aaf6458f28dc752b152f0cf666
Issue-ID: HOLMES-163
Signed-off-by: minfanyang <yang.minfan@zte.com.cn>
Diffstat (limited to 'rulemgt-frontend/src/app/correlation-modal/modal.component.ts')
-rw-r--r-- | rulemgt-frontend/src/app/correlation-modal/modal.component.ts | 51 |
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; + } } |