Last active
May 29, 2019 12:18
-
-
Save Oleg-Sulzhenko/38baf65710332089ecf0bc6d505f9a36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; }); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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