Skip to content

Commit a505e9a

Browse files
authored
Merge pull request #150 from stanislavgeorgiev/AlertModalComponent
fix(modal): Fix modal.service:show() `buttons` to be an array.
2 parents 51fb95c + aef3b14 commit a505e9a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/modal/alert-modal.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import Modal from "./modal.decorator";
6464
<p class="bx--modal-header__heading bx--type-beta">{{modalTitle}}</p>
6565
</ibm-modal-header>
6666
<div class="bx--modal-content">
67-
<p>{{modalContent}}</p>
67+
<p [innerHTML]="modalContent"></p>
6868
</div>
6969
<ibm-modal-footer *ngIf="buttons.length > 0">
7070
<ng-container *ngFor="let button of buttons; let i = index">

src/modal/modal.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ export class ModalService {
7070

7171
/**
7272
* Creates and renders a new alert modal component.
73-
* @param data You can pass in `title`, `text` and `buttons` to be used in the modal.
73+
* @param data You can pass in:
74+
* `modalType` - "default" | "danger" = "default",
75+
* `modalLabel` - a label shown over the title,
76+
* `modalTitle` - modal's title,
77+
* `modalContent` - modal's content, could include HTML tags.
7478
* `buttons` is an array of objects
7579
* ```
7680
* {
@@ -82,7 +86,7 @@ export class ModalService {
8286
* @returns {ComponentRef<any>}
8387
* @memberof ModalService
8488
*/
85-
show(data: {modalType?: string, modalLabel?: string, modalTitle: string, modalContent: string, buttons?: null}) {
89+
show(data: {modalType?: string, modalLabel?: string, modalTitle?: string, modalContent?: string, buttons?: []}) {
8690
return this.create({
8791
component: AlertModalComponent,
8892
inputs: {

0 commit comments

Comments
 (0)