Commit e2f2856a by Adarsh K

changes

parent 6f7f32fe
// tslint:disable-next-line:max-line-length
import { AfterViewInit, Component, ContentChildren, Directive, ElementRef, Input, OnInit, QueryList, TemplateRef, ViewChild, ViewChildren } from '@angular/core';
import { CarouselDirective } from './../../directives/carousel.directive';
import { animate, AnimationBuilder, AnimationFactory, AnimationPlayer, style } from '@angular/animations';
......@@ -15,7 +16,7 @@ export class CarouselItemElement {
styleUrls: ['./carousel.scss']
})
export class CarouselComponent implements AfterViewInit {
@ContentChildren(CarouselDirective) items: QueryList<CarouselDirective>;
@ContentChildren(CarouselDirective) items: QueryList<CarouselDirective>;
@ViewChildren(CarouselItemElement, { read: ElementRef }) private itemsElements: QueryList<ElementRef>;
@ViewChild('carousel', {static: false}) private carousel: ElementRef;
@Input() timing = '250ms ease-in';
......@@ -23,7 +24,7 @@ export class CarouselComponent implements AfterViewInit {
private player: AnimationPlayer;
private itemWidth: number;
private currentSlide = 0;
carouselWrapperStyle = {}
carouselWrapperStyle = {};
next() {
if (this.currentSlide + 1 === this.items.length) return;
......@@ -52,6 +53,7 @@ export class CarouselComponent implements AfterViewInit {
}
constructor(private builder: AnimationBuilder) {
console.log(this.items);
}
ngAfterViewInit() {
......
......@@ -7,4 +7,8 @@
width: auto;
}
}
}
.carousel-inner {
display: flex;
}
\ No newline at end of file
import {Component,OnInit} from '@angular/core';
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'offers',
......@@ -7,13 +7,14 @@ import {Component,OnInit} from '@angular/core';
})
export class OffersComponent {
items = [
{ title: 'Airfares starting at Rs. 899*', desc: 'Flights, 1080 Hotels, 410 Homestays,<br> Holiday Packages get 1080 Hotels, 410 Homestays..', code: 'AT 500' },
{ title: 'Airfares starting at Rs. 899*', desc: 'Flights, 1080 Hotels, 410 Homestays,<br> Holiday Packages get 1080 Hotels, 410 Homestays..', code: 'AT 500' },
{ title: 'Airfares starting at Rs. 899*', desc: 'Flights, 1080 Hotels, 410 Homestays,<br> Holiday Packages get 1080 Hotels, 410 Homestays..', code: 'AT 500' },
]
items: any;
ngOnInit() {
this.items = [
{ title: 'Airfares starting at Rs. 899*', desc: 'Flights, 1080 Hotels, 410 Homestays,<br> Holiday Packages get 1080 Hotels, 410 Homestays..', code: 'AT 500' },
{ title: 'Airfares starting at Rs. 899*', desc: 'Flights, 1080 Hotels, 410 Homestays,<br> Holiday Packages get 1080 Hotels, 410 Homestays..', code: 'AT 500' },
{ title: 'Airfares starting at Rs. 899*', desc: 'Flights, 1080 Hotels, 410 Homestays,<br> Holiday Packages get 1080 Hotels, 410 Homestays..', code: 'AT 500' },
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment