質問編集履歴
3
コード削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,83 +12,7 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
###該当のソースコード
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
```html
|
20
|
-
|
21
|
-
<!-- parent.component.heml -->
|
22
|
-
|
23
|
-
<div>
|
24
|
-
|
25
|
-
<mat-slider min="50" max="200" step="1" [(ngModel)]="value"></mat-slider>
|
26
|
-
|
27
|
-
<span>{{ value }}</span>
|
28
|
-
|
29
|
-
<div>
|
30
|
-
|
31
|
-
<svg [magnification]="value"></svg>
|
32
|
-
|
33
|
-
</div>
|
34
|
-
|
35
|
-
</div>
|
36
|
-
|
37
|
-
```
|
38
|
-
|
39
|
-
```html
|
40
|
-
|
41
|
-
<!-- svg.component.html -->
|
42
|
-
|
43
|
-
<div class="background">
|
44
|
-
|
45
|
-
<svg [attr.viewBox]="viewBox()">
|
46
|
-
|
47
|
-
<g>
|
48
|
-
|
49
|
-
<rect x="0" y="0" width="100" height="100"/>
|
50
|
-
|
51
|
-
</g>
|
52
|
-
|
53
|
-
</svg>
|
54
|
-
|
55
|
-
</div>
|
56
|
-
|
57
|
-
```
|
58
|
-
|
59
|
-
```typescript
|
60
|
-
|
61
|
-
//svg.component.ts
|
62
|
-
|
63
|
-
//import省略
|
64
|
-
|
65
|
-
@Component({
|
66
|
-
|
67
|
-
selector: 'svg',
|
68
|
-
|
69
|
-
etc...
|
70
|
-
|
71
|
-
)}
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
export class svgComponent {
|
76
|
-
|
77
|
-
@Input() magnification: number;
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
viewBox(): string{
|
82
|
-
|
83
|
-
return '0 0 ' + 100 * this.magniication / 100 + ' ' + 100 * this.magnification / 100;
|
84
|
-
|
85
|
-
}
|
86
|
-
|
87
|
-
}
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
```
|
92
16
|
|
93
17
|
ViewBoxのWidthとHeightをTypescript側で親のスライダーの値によって大きさを変えている状態です。
|
94
18
|
|
2
ファイル名の追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,9 +18,11 @@
|
|
18
18
|
|
19
19
|
```html
|
20
20
|
|
21
|
+
<!-- parent.component.heml -->
|
22
|
+
|
21
23
|
<div>
|
22
24
|
|
23
|
-
<mat-slider min="
|
25
|
+
<mat-slider min="50" max="200" step="1" [(ngModel)]="value"></mat-slider>
|
24
26
|
|
25
27
|
<span>{{ value }}</span>
|
26
28
|
|
@@ -36,7 +38,7 @@
|
|
36
38
|
|
37
39
|
```html
|
38
40
|
|
39
|
-
<!-- svg.html -->
|
41
|
+
<!-- svg.component.html -->
|
40
42
|
|
41
43
|
<div class="background">
|
42
44
|
|
@@ -55,6 +57,8 @@
|
|
55
57
|
```
|
56
58
|
|
57
59
|
```typescript
|
60
|
+
|
61
|
+
//svg.component.ts
|
58
62
|
|
59
63
|
//import省略
|
60
64
|
|
1
コードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,6 +13,26 @@
|
|
13
13
|
|
14
14
|
|
15
15
|
###該当のソースコード
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
```html
|
20
|
+
|
21
|
+
<div>
|
22
|
+
|
23
|
+
<mat-slider min="1" max="100" step="1" [(ngModel)]="value"></mat-slider>
|
24
|
+
|
25
|
+
<span>{{ value }}</span>
|
26
|
+
|
27
|
+
<div>
|
28
|
+
|
29
|
+
<svg [magnification]="value"></svg>
|
30
|
+
|
31
|
+
</div>
|
32
|
+
|
33
|
+
</div>
|
34
|
+
|
35
|
+
```
|
16
36
|
|
17
37
|
```html
|
18
38
|
|
@@ -34,6 +54,38 @@
|
|
34
54
|
|
35
55
|
```
|
36
56
|
|
57
|
+
```typescript
|
58
|
+
|
59
|
+
//import省略
|
60
|
+
|
61
|
+
@Component({
|
62
|
+
|
63
|
+
selector: 'svg',
|
64
|
+
|
65
|
+
etc...
|
66
|
+
|
67
|
+
)}
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
export class svgComponent {
|
72
|
+
|
73
|
+
@Input() magnification: number;
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
viewBox(): string{
|
78
|
+
|
79
|
+
return '0 0 ' + 100 * this.magniication / 100 + ' ' + 100 * this.magnification / 100;
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
```
|
88
|
+
|
37
89
|
ViewBoxのWidthとHeightをTypescript側で親のスライダーの値によって大きさを変えている状態です。
|
38
90
|
|
39
91
|
|