commencement de la 'page search'
This commit is contained in:
parent
5f4ecfc7b3
commit
58d80d1a6b
47 changed files with 889 additions and 84 deletions
34
src/app/user/search/video-grid/video-grid.component.ts
Normal file
34
src/app/user/search/video-grid/video-grid.component.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import {Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core';
|
||||
import {Video} from "../../../utils/interfaces/video";
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-video-grid',
|
||||
templateUrl: './video-grid.component.html',
|
||||
styleUrls: ['./video-grid.component.scss']
|
||||
})
|
||||
export class VideoGridComponent implements OnChanges
|
||||
{
|
||||
@Input() tabVideo: Video[] = [];
|
||||
tabTriplet = [];
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void
|
||||
{
|
||||
this.tabTriplet = [];
|
||||
let n = this.tabVideo.length;
|
||||
let i = 0;
|
||||
while(i < n)
|
||||
{
|
||||
let triplet = []
|
||||
let compteur = 0;
|
||||
while((compteur < 3) && (i < n))
|
||||
{
|
||||
triplet.push(this.tabVideo[i]);
|
||||
i++ ;
|
||||
compteur++ ;
|
||||
}
|
||||
this.tabTriplet.push(triplet)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in a new issue