File tree 4 files changed +18
-3
lines changed 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import {LoggingService} from './logging.service';
7
7
import { DataService } from './data.service' ;
8
8
import { NgbModule } from '@ng-bootstrap/ng-bootstrap' ;
9
9
import { Ng4TwitterTimelineModule } from 'ng4-twitter-timeline/lib/index' ;
10
+ import { EscapeHtmlPipe } from './keep-html.pipe' ;
10
11
11
12
import { AppComponent } from './app.component' ;
12
13
import { HomeComponent } from './home/home.component' ;
@@ -46,7 +47,8 @@ const APP_ROUTES : Routes = [
46
47
SpecialsComponent ,
47
48
GalleryComponent ,
48
49
SubmitComponent ,
49
- MusicComponent
50
+ MusicComponent ,
51
+ EscapeHtmlPipe
50
52
] ,
51
53
imports : [
52
54
BrowserModule ,
Original file line number Diff line number Diff line change
1
+ import { Pipe , PipeTransform } from '@angular/core' ;
2
+ import { DomSanitizer } from '@angular/platform-browser' ;
3
+
4
+ @Pipe ( { name : 'keepHtml' , pure : false } )
5
+ export class EscapeHtmlPipe implements PipeTransform {
6
+ constructor ( private sanitizer : DomSanitizer ) {
7
+ }
8
+
9
+ transform ( content ) {
10
+ return this . sanitizer . bypassSecurityTrustHtml ( content ) ;
11
+ }
12
+ }
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
- < div class =" e2e-trusted-url " [innerHTML] ='tune.SoundCloudEmbed '> </ div >
11
+ < div [innerHTML] ='tune.SoundCloudEmbed | keepHtml '> </ div >
12
12
</ ng-container >
13
13
</ div >
14
14
</ div >
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ export class MusicComponent implements OnInit {
11
11
12
12
tunes :any = [ ] ;
13
13
14
- constructor ( private dataService : DataService ) { }
14
+ constructor ( private dataService : DataService ) {
15
+ }
15
16
16
17
ngOnInit ( ) {
17
18
//this.phpGetMusic();
You can’t perform that action at this time.
0 commit comments