import { Component, OnInit } from '@angular/core'; // <-- add OnInit
declare const $; // <-- declare const for jQuery $
declare const Swiper; // <-- declare const for Swiper
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit { // <-- OnInit implementation
ngOnInit(): void { // <-- OnInit void
$(function() { // <-- jQuery function
var mySwiper = new Swiper ('.swiper-container', { // <-- Swiper options
// Optional parameters
loop: true,
pagination: {
el: '.swiper-pagination',
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
});
});
}
}
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.