67 lines
1.8 KiB
TypeScript
67 lines
1.8 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { Router } from '@angular/router';
|
|
import { Sistemas } from '../models/sistemasModel';
|
|
import { SistemasService } from '../services/sistemas.service';
|
|
import { environment } from 'src/environments/environment';
|
|
import { Slides } from '../models/sliderModel';
|
|
import { SliderService } from '../services/slider.service';
|
|
import { Noticias } from '../models/noticiasModel';
|
|
import { NoticiasService } from '../services/noticias.service';
|
|
import { SwiperOptions } from 'swiper';
|
|
|
|
@Component({
|
|
selector: 'app-home',
|
|
templateUrl: './home.component.html',
|
|
styleUrls: ['./home.component.scss']
|
|
})
|
|
export class HomeComponent implements OnInit {
|
|
|
|
config: SwiperOptions = {
|
|
pagination: {
|
|
el: '.swiper-pagination',
|
|
clickable: true
|
|
},
|
|
navigation: {
|
|
nextEl: '.swiper-button-next',
|
|
prevEl: '.swiper-button-prev'
|
|
},
|
|
spaceBetween: 24,
|
|
loop: true,
|
|
speed: 700,
|
|
autoplay: {
|
|
delay: 8000,
|
|
disableOnInteraction: false
|
|
}
|
|
};
|
|
|
|
ListaDeSlides: Slides[] = [];
|
|
ListaDeSistemas: Sistemas[] = [];
|
|
ListaDeNoticias: Noticias[] = [];
|
|
|
|
LinkProjeto: string = environment.LinkProjeto;
|
|
|
|
constructor(
|
|
private sistemasService: SistemasService,
|
|
private router: Router,
|
|
private sliderService: SliderService,
|
|
private noticiasService: NoticiasService
|
|
) { }
|
|
|
|
ngOnInit() {
|
|
this.sliderService.getSlidesEn().then(resSlides => {
|
|
this.ListaDeSlides = resSlides || [];
|
|
});
|
|
|
|
this.sistemasService.getSistemasEn().then(resSistemas => {
|
|
this.ListaDeSistemas = resSistemas || [];
|
|
});
|
|
|
|
this.noticiasService.getNoticiasEn().then(resNoticias => {
|
|
this.ListaDeNoticias = resNoticias || [];
|
|
});
|
|
}
|
|
|
|
AbrirDetalhesSistema(Sistema: Sistemas) {
|
|
this.router.navigate(['/detalhes/' + Sistema.idsistemas]);
|
|
}
|
|
} |