| 
									
										
										
										
											2016-05-03 14:06:32 +02:00
										 |  |  | import { Component } from '@angular/core'; | 
					
						
							| 
									
										
										
										
											2016-01-27 14:49:02 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-03 14:06:32 +02:00
										 |  |  | import { MovieService } from './movie.service'; | 
					
						
							|  |  |  | import { IMovie } from './movie'; | 
					
						
							| 
									
										
										
										
											2016-01-27 14:49:02 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | @Component({ | 
					
						
							| 
									
										
										
										
											2016-09-25 18:51:54 -07:00
										 |  |  |   moduleId: module.id, | 
					
						
							| 
									
										
										
										
											2016-01-27 14:49:02 -08:00
										 |  |  |   selector: 'my-app', | 
					
						
							| 
									
										
										
										
											2016-09-25 18:51:54 -07:00
										 |  |  |   templateUrl: 'app.component.html', | 
					
						
							|  |  |  |   styleUrls: [ 'app.component.css' ], | 
					
						
							|  |  |  |   providers: [ MovieService ] | 
					
						
							| 
									
										
										
										
											2016-01-27 14:49:02 -08:00
										 |  |  | }) | 
					
						
							|  |  |  | export class AppComponent { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-27 11:28:22 -07:00
										 |  |  |   angularDocsUrl = 'https://angular.io/'; | 
					
						
							| 
									
										
										
										
											2016-01-27 14:49:02 -08:00
										 |  |  |   colorPreference = 'red'; | 
					
						
							|  |  |  |   eventType = '<not clicked yet>'; | 
					
						
							|  |  |  |   isActive = true; | 
					
						
							|  |  |  |   isImportant = true; | 
					
						
							|  |  |  |   movie: IMovie = null; | 
					
						
							|  |  |  |   movies: IMovie[] = []; | 
					
						
							|  |  |  |   showImage = true; | 
					
						
							| 
									
										
										
										
											2016-04-27 11:28:22 -07:00
										 |  |  |   title: string = 'A1-A2 Quick Ref Cookbook'; | 
					
						
							|  |  |  |   toggleImage(event: UIEvent) { | 
					
						
							| 
									
										
										
										
											2016-01-27 14:49:02 -08:00
										 |  |  |     this.showImage = !this.showImage; | 
					
						
							|  |  |  |     this.eventType = (event && event.type) || 'not provided'; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   constructor(movieService: MovieService) { | 
					
						
							|  |  |  |     this.movies = movieService.getMovies(); | 
					
						
							|  |  |  |     this.movie = this.movies[0]; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-02-24 23:28:45 -08:00
										 |  |  | } |