简体   繁体   English

角度2材质对话框

[英]Angular 2 Material Dialog box

I am making an application with Angular 2 and Angular Material 2 and on one of the pages I have to use a dialog box. 我正在使用Angular 2和Angular Material 2制作应用程序,并且在其中一个页面上必须使用一个对话框。 I checked out the description and usage on the MdDialog docs but that didn't solve my problem with my dialog box. 我在MdDialog文档上签出了说明和用法,但这不能解决我的对话框问题。

What I want for my dialog box is that when I open the dialog box, it shows me a list and when I click on one of the element of the list it goes to more options of that list. 我想要的对话框是,当我打开对话框时,它向我显示一个列表,当我单击列表中的一个元素时,它将转到该列表的更多选项。

--------------
|  Heading   |
| Option 1   |
| Option 2   |    --->  ----------------
| Option 3   |          | <-- Option 1 |
| Option 4   |          |  Option 1    |
| Option 5   |          |  Option 2    |
| Cancel  Ok |          |  Cancel   Ok |
-------------           ----------------

So like it is showed in the design when I click Option 1 then it takes me to more options of Option 1. And all of this is in the dialog box. 就像我单击选项1时在设计中显示的那样,然后将我带到选项1的更多选项。所有这些都在对话框中。 So how can I do this? 那我该怎么做呢? Thanks!! 谢谢!!

You could have a component in the dialog box that changes based on what the used clicked on. 您可能在对话框中有一个组件,该组件会根据所单击的内容进行更改。 This way, you can open a dialog box, then the user can keep interacting with it, as the options inside it change. 这样,您可以打开一个对话框,然后用户可以继续与它进行交互,因为其中的选项会发生变化。 Then, you may close it, just like any MdDialog . 然后,您可以将其关闭,就像任何MdDialog

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM