import { Component, OnInit } from '@angular/core';
import { NgxCarousel } from 'ngx-carousel';
import { Router,ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-cart',
  templateUrl: './cart.component.html',
  styleUrls: ['./cart.component.scss']
})
export class CartComponent implements OnInit {
  count:any;
  public carouselTile: NgxCarousel;
  constructor(
    private router        : Router, 
    private route         : ActivatedRoute
  ) { 
    this.count = 0;
  }

  add(){
    this.count = this.count + 1;
  }
  
  minus(){
    this.count = this.count - 1;
    if(this.count < 0){
      this.count = 0;
    }
  }
  

  ngOnInit() {
    this.carouselTile = {grid: {xs: 1, sm: 2 , md: 4, lg: 8, all: 0},slide: 1, speed: 400,point: { visible: false },load: 2, touch: true, easing: 'ease'}
  }

  goToPage(path,data=null){
    this.router.navigateByUrl(path,{queryParams:data});
    document.body.scrollTop = document.documentElement.scrollTop = 0;
  }

  carouselTileLoad(){ return ''; }

}
