2017-02-22 18:13:21 +00:00
|
|
|
// #docregion
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
|
2020-07-30 13:03:09 +03:00
|
|
|
import { AdService } from './ad.service';
|
|
|
|
import { AdItem } from './ad-item';
|
2017-02-22 18:13:21 +00:00
|
|
|
|
|
|
|
@Component({
|
2017-08-22 21:31:15 +02:00
|
|
|
selector: 'app-root',
|
2017-02-22 18:13:21 +00:00
|
|
|
template: `
|
|
|
|
<div>
|
2018-02-12 16:34:38 -05:00
|
|
|
<app-ad-banner [ads]="ads"></app-ad-banner>
|
2017-02-22 18:13:21 +00:00
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
export class AppComponent implements OnInit {
|
|
|
|
ads: AdItem[];
|
|
|
|
|
|
|
|
constructor(private adService: AdService) {}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.ads = this.adService.getAds();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|