Как заставить AOS работать с размерами Dynami c, используя angular? - PullRequest
0 голосов
/ 05 марта 2020

Я использую AOS для анимации Это страница

И у меня возникла проблема с тем, чтобы она работала на angular. Я установил его, и он, кажется, работает только после refre sh. Это код вопроса:


<div *ngFor="let article of data;let index = index" class="row">
    <div class="col-12 col-md-7 col-lg-8">
        <h2 class="titulo">
            {{article.titulo}}
        </h2>
        <h3>
            {{article.tipo}}
        </h3>
        <p>
            {{article.descripcion}}
        </p>
        <p class="redirect">
            redirect
        </p>
    </div>
    <div class="col-12 col-md-5 col-lg-4">
        <img data-aos="fade-up-right" (click)="toDatos()" class="imgcarta" animateOnScroll animationName="grower" src={{article.foto}}>
    </div>
</div>

<app-footer id="footer"></app-footer>```

The steps I've followed to install AOS were the following:

-Installing it using "npm install aos --save"
-Adding AOS js and css to my angular.json file.
-importing: "import * as AOS from 'aos';" to my app.component.ts and putting "AOS.init();" on ngOnInit

I believe the issue is caused because of all my elements being generated inside the *ngFor, but i can't assure it.
...