How to close modal using a button inside component

2 posts, 0 answers
  1. Gek Teng
    Gek Teng avatar
    2 posts
    Member since:
    Jul 2017

    Posted 28 Aug 2017 Link to this post


    With reference to using component with dialog service (, I have a form inside the component and I would like to submit the form and close the modal using a button from inside the component rather than using the action buttons.

    How should I go about achieving that?

    Please refer to the following plunker:

  2. Alex Gyoshev
    Alex Gyoshev avatar
    2522 posts

    Posted 31 Aug 2017 Link to this post

    Hello Gek,

    There are multiple ways to achieve this, depending on your requirements and preference.

    If you need the button to be styled consistently as buttons in other dialogs, it can trigger actions on the child component. To achieve this, subscribe to the dialog result and call methods on the component instance, as shown in this plunker snippet.

    If you need the button to be inside the nested component, you can trigger an event and bind the dialog close action to it, as shown in this plunker.

    Alex Gyoshev
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top