| 
									
										
										
										
											2016-05-18 15:53:13 +02:00
										 |  |  | import { Component, OnInit } from '@angular/core'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-27 03:58:10 -04:00
										 |  |  | import { ToastService } from './core'; | 
					
						
							| 
									
										
										
										
											2016-05-18 15:53:13 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | @Component({ | 
					
						
							|  |  |  |   selector: 'sg-app', | 
					
						
							|  |  |  |   template: `
 | 
					
						
							|  |  |  |     <button (click)="show()">Show toast</button> | 
					
						
							|  |  |  |     <button (click)="hide()">Hide toast</button> | 
					
						
							|  |  |  |   `,
 | 
					
						
							|  |  |  |   providers: [ToastService] | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | export class AppComponent implements OnInit { | 
					
						
							|  |  |  |   constructor(private toastService: ToastService) { } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   hide() { | 
					
						
							|  |  |  |     this.toastService.hide(); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   show() { | 
					
						
							|  |  |  |     this.toastService.show(); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ngOnInit() { | 
					
						
							|  |  |  |     this.toastService.activate('Hello style-guide!'); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } |