@@ -6,9 +6,13 @@ <h1>Dialog demo</h1>
6
6
< button mat-raised-button color ="accent " (click) ="openContentElement() ">
7
7
Open dialog with content elements
8
8
</ button >
9
- < button mat-raised-button color ="accent " (click) ="openTemplate() ">
9
+ < button mat-raised-button color ="accent " (click) ="openTemplate(templateDialog ) ">
10
10
Open dialog with template content
11
11
</ button >
12
+ < button mat-raised-button color ="accent " (click) ="openTemplate(templateDialogWithContent) ">
13
+ Open template dialog with content elements
14
+ </ button >
15
+
12
16
13
17
< mat-card class ="demo-dialog-card ">
14
18
< mat-card-content >
@@ -98,7 +102,7 @@ <h2>Other options</h2>
98
102
< p > Last afterClosed result: {{lastAfterClosedResult}}</ p >
99
103
< p > Last beforeClose result: {{lastBeforeCloseResult}}</ p >
100
104
101
- < ng-template let-data let-dialogRef ="dialogRef ">
105
+ < ng-template #templateDialog let-data let-dialogRef ="dialogRef ">
102
106
I'm a template dialog. I've been opened {{numTemplateOpens}} times!
103
107
104
108
< p > It's Jazz!</ p >
@@ -109,5 +113,33 @@ <h2>Other options</h2>
109
113
110
114
< p > {{ data.message }} </ p >
111
115
< button type ="button " (click) ="dialogRef.close(lastCloseResult = howMuch.value) "> Close dialog</ button >
112
- < button (click) ="dialogRef.updateSize('500px', '500px').updatePosition({ top: '25px', left: '25px' }); "> Change dimensions</ button > `
116
+ < button (click) ="dialogRef.updateSize('500px', '500px').updatePosition({ top: '25px', left: '25px' }); "> Change dimensions</ button >
117
+ </ ng-template >
118
+
119
+ < ng-template #templateDialogWithContent let-data let-dialogRef ="dialogRef ">
120
+ < h2 mat-dialog-title > Saturn</ h2 >
121
+
122
+ < mat-dialog-content >
123
+ < 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 ">
124
+ Saturn is the sixth planet from the Sun and the second-largest in the Solar System, after
125
+ Jupiter. It is a gas giant with an average radius about nine times that of Earth. It has
126
+ only one-eighth the average density of Earth, but with its larger volume Saturn is over
127
+ 95 times more massive. Saturn is named after the Roman god of agriculture; its astronomical
128
+ symbol (♄) represents the god's sickle.
129
+
130
+ Saturn's interior is probably composed of a core of iron–nickel and rock
131
+ (silicon and oxygen compounds). This core is surrounded by a deep layer of metallic hydrogen,
132
+ an intermediate layer of liquid hydrogen and liquid helium, and finally a gaseous outer layer.
133
+ Saturn has a pale yellow hue due to ammonia crystals in its upper atmosphere. Electrical
134
+ current within the metallic hydrogen layer is thought to give rise to Saturn's planetary
135
+ magnetic field, which is weaker than Earth's, but has a magnetic moment 580 times that of
136
+ Earth due to Saturn's larger size. Saturn's magnetic field strength is around one-twentieth
137
+ of Jupiter's. The outer atmosphere is generally bland and lacking in contrast, although
138
+ long-lived features can appear. Wind speeds on Saturn can reach 1,800 km/h (1,100 mph),
139
+ higher than on Jupiter, but not as high as those on Neptune.
140
+ </ mat-dialog-content >
141
+
142
+ < mat-dialog-actions >
143
+ < button mat-raised-button color ="primary " (click) ="dialogRef.close() "> Close dialog</ button >
144
+ </ mat-dialog-actions >
113
145
</ ng-template >
0 commit comments