Update adbutler.component.ts

This commit is contained in:
piotrpekala7 2020-08-06 10:08:40 +02:00
parent 29e8949872
commit d1fb7e6624

View File

@ -23,7 +23,7 @@ export class AdbutlerComponent implements OnInit {
this.httpClient this.httpClient
.get('https://servedbyadbutler.com/adserve/;ID=165803;size=0x0;setID=371476;type=json;').subscribe( .get('https://servedbyadbutler.com/adserve/;ID=165803;size=0x0;setID=371476;type=json;').subscribe(
response => { response => {
if (response && response['placements']) { if (response && response['placements'] && response['placements'].placement_1 && response['placements'].placement_1.body) {
this.onLoad.emit(true); this.onLoad.emit(true);
this.htmlCode = response['placements'].placement_1.body; this.htmlCode = response['placements'].placement_1.body;
this.ad.nativeElement.insertAdjacentHTML('beforeend', this.htmlCode); this.ad.nativeElement.insertAdjacentHTML('beforeend', this.htmlCode);