Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ati
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
amal
ati
Commits
e2f2856a
Commit
e2f2856a
authored
Sep 26, 2019
by
Adarsh K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes
parent
6f7f32fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
carousel.component.ts
src/app/home/carousel/carousel.component.ts
+4
-2
carousel.scss
src/app/home/carousel/carousel.scss
+5
-0
offers.component.ts
src/app/home/offers/offers.component.ts
+7
-6
No files found.
src/app/home/carousel/carousel.component.ts
View file @
e2f2856a
// 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
()
{
...
...
src/app/home/carousel/carousel.scss
View file @
e2f2856a
...
...
@@ -7,4 +7,8 @@
width
:
auto
;
}
}
}
.carousel-inner
{
display
:
flex
;
}
\ No newline at end of file
src/app/home/offers/offers.component.ts
View file @
e2f2856a
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'
},
]
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment