-
Notifications
You must be signed in to change notification settings - Fork 313
fix(modal): Fix modal.service:show() buttons
to be an array.
#150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(modal): Fix modal.service:show() buttons
to be an array.
#150
Conversation
fix(modal): Added more documentation. feat(modal): modal.service:show() can now supports HTML in `modalContent`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple comments for thought, but otherwise LGTM
@@ -64,7 +64,7 @@ import Modal from "./modal.decorator"; | |||
<p class="bx--modal-header__heading bx--type-beta">{{modalTitle}}</p> | |||
</ibm-modal-header> | |||
<div class="bx--modal-content"> | |||
<p>{{modalContent}}</p> | |||
<p [innerHTML]="modalContent"></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is probably okay (I can certainly see some use cases), but a ng-template
output should probably be added as the default way to inject complex html content.
That of course could be added as a feature later, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, makes sense! The use case in my head was if I want to show this as content:
Are you sure you want to delete <strong>this item name</strong>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep makes sense, and I think we already support that for banners/notifications (which have a similar usage model)
@@ -82,7 +86,7 @@ export class ModalService { | |||
* @returns {ComponentRef<any>} | |||
* @memberof ModalService | |||
*/ | |||
show(data: {modalType?: string, modalLabel?: string, modalTitle: string, modalContent: string, buttons?: null}) { | |||
show(data: {modalType?: string, modalLabel?: string, modalTitle?: string, modalContent?: string, buttons?: []}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
if we wanted to get really fancy we could declare a interface ModalButton
and type buttons
to buttons?: ModalButton[]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeap, would definitely add that in the future!
I'm still an Angular NOOB but also really pressed for our project's release in 3 weeks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I'll make an issue to note that 👍
🎉 This PR is included in version 1.8.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
fix(modal): Added more documentation.
feat(modal): modal.service:show() can now supports HTML in
modalContent
.