Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/lib/dialog/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,30 @@ Components created via `MdDialog` can _inject_ `MdDialogRef` and use it to close
in which they are contained. When closing, an optional result value can be provided. This result
value is forwarded as the result of the `afterClosed` promise.

### Sharing data with the Dialog component.
If you want to share data with your dialog, you can use the `data` option to pass information to the dialog component.

```ts
let dialogRef = dialog.open(YourDialog, {
data: 'your data',
});
```

To access the data in your dialog component, you have to use the MD_DIALOG_DATA injection token:
```ts
import {Component, Inject} from '@angular/core';
import {MD_DIALOG_DATA} from '@angular/material';

@Component({
selector: 'your-dialog',
template: 'passed in {{ data }}',
})

export class YourDialog {
constructor(@Inject(MD_DIALOG_DATA) public data: any) { }
}
```

### Dialog content
Several directives are available to make it easier to structure your dialog content:

Expand Down