Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

carousel not moving unless reload the page

import { AfterViewInit, Component, ElementRef, OnInit } from '@angular/core';
declare var $: any; // used to access jQuery

@Component({
  selector: 'app-home-page',
  templateUrl: './home-page.component.html',
  styleUrls: ['./home-page.component.scss']
})
export class HomePageComponent implements OnInit, AfterViewInit {
  
  @ViewChild('carousel') _carousel!: ElementRef;

  constructor() { }

  ngOnInit(): void {
  }

  ngAfterViewInit() {
    const carouselElem = this._carousel?.nativeElement;
    const carousel = $(carouselElem).carousel();
  }

}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #carousel #moving #reload #page
ADD COMMENT
Topic
Name
3+1 =