Skip to content
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

Passing local data to md dialog??? #2086

Closed
dreweird opened this issue Dec 6, 2016 · 2 comments
Closed

Passing local data to md dialog??? #2086

dreweird opened this issue Dec 6, 2016 · 2 comments
Assignees
Labels
docs This issue is related to documentation

Comments

@dreweird
Copy link

dreweird commented Dec 6, 2016

----in my html code---
<td *ngIf="item.clickable=='yes'" (click)="openDialog(item)">{{item.kilo[0] | number: '1.2-2'}}</td>

---in my component code---

 openDialog(item) {
    let dialogRef = this._dialog.open(DialogContent);

    dialogRef.afterClosed().subscribe(result => {
      this.lastDialogResult = result;
    })
  }

How to show the local variables in the md-dialog template???? I want to display the value of item

@Component({
  template: `
    <p>This is a dialog</p>
    <p>
    {{item}}
      <label>
        This is a text box inside of a dialog.
        <input #dialogInput>
      </label>
    </p>
    <p> <button md-button (click)="dialogRef.close(dialogInput.value)">CLOSE</button> </p>
  `,
})
export class DialogContent {
  constructor(@Optional() public dialogRef: MdDialogRef<DialogContent>) { }
}
@crisbeto
Copy link
Member

crisbeto commented Dec 6, 2016

Try the suggestion from here. We should probably document this option a little bit better.

EDIT: Seems like we already have #1947 to keep track of this. I'll close the issue as a dupe.

@crisbeto crisbeto self-assigned this Dec 6, 2016
@crisbeto crisbeto added the docs This issue is related to documentation label Dec 6, 2016
@crisbeto crisbeto closed this as completed Dec 6, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs This issue is related to documentation
Projects
None yet
Development

No branches or pull requests

2 participants