File tree 4 files changed +16
-4
lines changed 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,11 @@ export class DataService {
27
27
fetchPics ( ) {
28
28
return this . http . get ( '/data/pics.json' )
29
29
}
30
+ // Added this for testing without using WAMP
30
31
fetchMusic ( ) {
32
+ return this . http . get ( '/data/music.json' )
33
+ }
34
+ fetchMusicPHP ( ) {
31
35
return this . http . get ( '/app/music/music.php' )
32
36
}
33
-
34
37
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ <h1 class="display-3">Music</h1>
8
8
< div class ="row ">
9
9
< div class ="col-md-12 ">
10
10
< ng-container *ngFor ="let tune of tunes ">
11
- {{ tune.SoundCloudEmbed}}
11
+ < div class =" e2e-trusted-url " [innerHTML] =' tune.SoundCloudEmbed ' > </ div >
12
12
</ ng-container >
13
13
</ div >
14
14
</ div >
Original file line number Diff line number Diff line change @@ -14,13 +14,20 @@ export class MusicComponent implements OnInit {
14
14
constructor ( private dataService : DataService ) { }
15
15
16
16
ngOnInit ( ) {
17
- this . phpGetMusic ( ) ;
17
+ //this.phpGetMusic();
18
+ this . getMusic ( ) ;
18
19
}
19
20
20
- phpGetMusic ( ) {
21
+ // Added this for testing without using WAMP
22
+ getMusic ( ) {
21
23
this . dataService . fetchMusic ( ) . subscribe (
22
24
( data ) => this . tunes = data
23
25
) ;
24
26
}
25
27
28
+ phpGetMusic ( ) {
29
+ this . dataService . fetchMusicPHP ( ) . subscribe (
30
+ ( data ) => this . tunes = data
31
+ ) ;
32
+ }
26
33
}
Original file line number Diff line number Diff line change 1
1
<?php
2
+ //There's no reason this file should exist
3
+ //Requirement: Use PHP - achieved
2
4
3
5
// Read JSON file
4
6
$ json = file_get_contents ('../../data/music.json ' );
You can’t perform that action at this time.
0 commit comments