@@ -6,9 +6,13 @@ <h1>Dialog demo</h1>
66< button mat-raised-button color ="accent " (click) ="openContentElement() ">
77 Open dialog with content elements
88</ button >
9- < button mat-raised-button color ="accent " (click) ="openTemplate() ">
9+ < button mat-raised-button color ="accent " (click) ="openTemplate(templateDialog ) ">
1010 Open dialog with template content
1111</ button >
12+ < button mat-raised-button color ="accent " (click) ="openTemplate(templateDialogWithContent) ">
13+ Open template dialog with content elements
14+ </ button >
15+
1216
1317< mat-card class ="demo-dialog-card ">
1418 < mat-card-content >
@@ -111,7 +115,7 @@ <h2>Other options</h2>
111115< p > Last afterClosed result: {{lastAfterClosedResult}}</ p >
112116< p > Last beforeClose result: {{lastBeforeCloseResult}}</ p >
113117
114- < ng-template let-data let-dialogRef ="dialogRef ">
118+ < ng-template #templateDialog let-data let-dialogRef ="dialogRef ">
115119 I'm a template dialog. I've been opened {{numTemplateOpens}} times!
116120
117121 < p > It's Jazz!</ p >
@@ -123,5 +127,33 @@ <h2>Other options</h2>
123127
124128 < p > {{ data.message }} </ p >
125129 < button type ="button " (click) ="dialogRef.close(lastCloseResult = howMuch.value) "> Close dialog</ button >
126- < button (click) ="dialogRef.updateSize('500px', '500px').updatePosition({ top: '25px', left: '25px' }); "> Change dimensions</ button > `
130+ < button (click) ="dialogRef.updateSize('500px', '500px').updatePosition({ top: '25px', left: '25px' }); "> Change dimensions</ button >
131+ </ ng-template >
132+
133+ < ng-template #templateDialogWithContent let-data let-dialogRef ="dialogRef ">
134+ < h2 mat-dialog-title > Saturn</ h2 >
135+
136+ < mat-dialog-content >
137+ < img style ="max-width: 100%; " src ="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Saturn_during_Equinox.jpg/1920px-Saturn_during_Equinox.jpg " alt ="Saturn ">
138+ Saturn is the sixth planet from the Sun and the second-largest in the Solar System, after
139+ Jupiter. It is a gas giant with an average radius about nine times that of Earth. It has
140+ only one-eighth the average density of Earth, but with its larger volume Saturn is over
141+ 95 times more massive. Saturn is named after the Roman god of agriculture; its astronomical
142+ symbol (♄) represents the god's sickle.
143+
144+ Saturn's interior is probably composed of a core of iron–nickel and rock
145+ (silicon and oxygen compounds). This core is surrounded by a deep layer of metallic hydrogen,
146+ an intermediate layer of liquid hydrogen and liquid helium, and finally a gaseous outer layer.
147+ Saturn has a pale yellow hue due to ammonia crystals in its upper atmosphere. Electrical
148+ current within the metallic hydrogen layer is thought to give rise to Saturn's planetary
149+ magnetic field, which is weaker than Earth's, but has a magnetic moment 580 times that of
150+ Earth due to Saturn's larger size. Saturn's magnetic field strength is around one-twentieth
151+ of Jupiter's. The outer atmosphere is generally bland and lacking in contrast, although
152+ long-lived features can appear. Wind speeds on Saturn can reach 1,800 km/h (1,100 mph),
153+ higher than on Jupiter, but not as high as those on Neptune.
154+ </ mat-dialog-content >
155+
156+ < mat-dialog-actions >
157+ < button mat-raised-button color ="primary " (click) ="dialogRef.close() "> Close dialog</ button >
158+ </ mat-dialog-actions >
127159</ ng-template >
0 commit comments