Skip to content

Instantly share code, notes, and snippets.

@Oleg-Sulzhenko
Last active May 29, 2019 12:18
Show Gist options
  • Save Oleg-Sulzhenko/38baf65710332089ecf0bc6d505f9a36 to your computer and use it in GitHub Desktop.
Save Oleg-Sulzhenko/38baf65710332089ecf0bc6d505f9a36 to your computer and use it in GitHub Desktop.
public openModal(jobToEdit: RecurrentJob): void {
let dialogRef = this.dialog.open(AddEditJobFormComponent, {
width: '600px',
data: { exampleDataPassedToDialog: 'some Data' } // you can pass Data here instead of Input()
});
dialogRef.componentInstance.jobToEdit = jobToEdit;
dialogRef.componentInstance.formData.subscribe((formData: RecurrentJob) => {
this.newJob.next(formData);
});
dialogRef.afterClosed().pipe(take(1)).subscribe(() => { dialogRef = null; });
}
<span (click)="showMore(fullDescription)">More</span>
<ng-template #fullDescription>
<p style="margin-bottom: 0;">{{ job.description }}</p>
</ng-template>
showModal(templateRef) {
let dialogRef = this.dialog.open(templateRef, {
width: '600px',
});
dialogRef.afterClosed().pipe(take(1)).subscribe(() => { dialogRef = null; });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment