continuation de la page 'search', mise en place des pubs
This commit is contained in:
parent
45f9057490
commit
8784c290ca
37 changed files with 559 additions and 258 deletions
27
src/app/utils/components/advert/advert.component.ts
Normal file
27
src/app/utils/components/advert/advert.component.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import {Component, Input, OnInit} from '@angular/core';
|
||||
import {Advert} from "../../interfaces/advert";
|
||||
import {ThemeService} from "../../services/theme/theme.service";
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-advert',
|
||||
templateUrl: './advert.component.html',
|
||||
styleUrls: ['./advert.component.scss']
|
||||
})
|
||||
export class AdvertComponent implements OnInit
|
||||
{
|
||||
@Input() ad: Advert;
|
||||
idxImage: number = 0;
|
||||
|
||||
|
||||
constructor(public themeService: ThemeService) { }
|
||||
|
||||
|
||||
ngOnInit(): void
|
||||
{
|
||||
const nbImages = this.ad.images.length;
|
||||
this.idxImage = Math.floor(Math.random() * nbImages);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in a new issue