app.component.ts 999 Bytes
Newer Older
mdsecurity's avatar
mdsecurity committed
1
import { Component } from '@angular/core';
mdsecurity's avatar
mdsecurity committed
2
3
import { DataProviderService } from './data-provider.service';
import { Place } from './place';
mdsecurity's avatar
mdsecurity committed
4
import { SearchService } from './search.service';
mdsecurity's avatar
mdsecurity committed
5
6
7
8
9
10
11
12
import {
	trigger,
	state,
	style,
	animate,
	transition,
	keyframes
} from '@angular/animations';
mdsecurity's avatar
mdsecurity committed
13
@Component({
mdsecurity's avatar
mdsecurity committed
14
15
16
	selector: 'app-root',
	templateUrl: './app.component.html',
	styleUrls: ['./app.component.scss'],
mdsecurity's avatar
mdsecurity committed
17
	providers: [DataProviderService, SearchService],
mdsecurity's avatar
mdsecurity committed
18
19
20
21
22
23
24
25
26
27
28
29
	animations: [
		trigger('nav-bar-state', [
			state('expanded', style({
				transform: 'translateY(325px)',
			})),
			state('collapsed', style({
				transform: 'translateY(0px)',
			})),
			transition('expanded => collapsed', animate('250ms cubic-bezier(.35,0,.61,1)')),
			transition('collapsed => expanded', animate('250ms ease-in-out'))
		])
	]
mdsecurity's avatar
mdsecurity committed
30
31
})
export class AppComponent {
mdsecurity's avatar
mdsecurity committed
32
33
34
35
	navState='expanded';
	toggleNavState(event): void {
		if (event === 'expanded') {
			this.navState = 'expanded';
mdsecurity's avatar
mdsecurity committed
36

mdsecurity's avatar
mdsecurity committed
37
38
39
40
		} else {
			this.navState = 'collapsed';
		}
	}	
mdsecurity's avatar
mdsecurity committed
41
}