[Library | Trunk]: Full page slider add param for initial state

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58941 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-06-16 17:07:32 +00:00
parent b819a68e96
commit a5e0a64938
2 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,4 @@
import {AfterContentInit, Component, ContentChildren, QueryList} from "@angular/core";
import {AfterContentInit, Component, ContentChildren, Input, OnInit, QueryList} from "@angular/core";
import {SlideComponent} from "./slide.component";
@Component({
@ -12,13 +12,14 @@ import {SlideComponent} from "./slide.component";
export class FullPageSliderComponent implements AfterContentInit {
@ContentChildren(SlideComponent) slides: QueryList<SlideComponent>;
@Input()
public initSlide = 1;
public animate: boolean = false;
public state = 0;
ngAfterContentInit() {
this.setSlides();
this.state = 1;
this.state = this.initSlide;
this.setSlides(this.state);
}
setSlides(state = 1) {

View File

@ -7,7 +7,7 @@ import {transition, trigger} from "@angular/animations";
template: `
<div @blockInitialRenderAnimation>
<div [@state]="{value: state, params: {y: y}}"
style="position: absolute;top: 40%;left: 50%;width: 100%;">
style="position: absolute;top: 40%;left: 50%;width: 100%;min-height: 50vh">
<ng-content></ng-content>
</div>
</div>