Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / How to open Dialog window without button

How to open Dialog window without button

New Discussion
Shailesh Bhat
Shailesh Bhat asked on Jan 14, 2019 3:41 PM

Hi, In all of your samples, you have shown the dialog window with a Button(click event of button to open dialog window). But I need to open it from typescript(either using constructor/ngOnInit/using isOpen Accessors). Can you please help me for this?..

Sign In to post a reply

Replies

  • 0
    Radoslav Karaivanov
    Radoslav Karaivanov answered on Jan 14, 2019 9:45 AM

    Hello Shailesh,

    Thank you for contacting Infragistics Developer Support!

    Yes, it is possible to toggle the dialog component from your typescript code. You only need to get a reference to it from your component and use the dialog API to manipulate it.

    I have also made a sample which showcases a dialog opening 3 seconds after the component has loaded.

    • 0
      Shailesh Bhat
      Shailesh Bhat answered on Jan 14, 2019 10:19 AM

      Thanks..and how to bind the message from typescript?..I need to bind the message from typescript side..

      • 0
        Radoslav Karaivanov
        Radoslav Karaivanov answered on Jan 14, 2019 3:41 PM

        If your dialog is a simple text box you can use the message property of the dialog instance in your typescript file. In the case of more involved templating you should just change the values inside the template before opening the dialog.

        In the case of the provided sample above this will be:

        ngAfterViewInit() {
            this.dialog.message = '';
            setTimeout(() => this.dialog.open(), 3000);
          }

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Shailesh Bhat
Favorites
0
Replies
3
Created On
Jan 14, 2019
Last Post
7 years, 1 month ago

Suggested Discussions

Tags

Created by

Created on

Jan 14, 2019 3:41 PM

Last activity on

Feb 23, 2026 8:35 AM